pyvista / pyvista-support

[moved] Please head over to the Discussions tab of the PyVista repository
https://github.com/pyvista/pyvista/discussions
59 stars 4 forks source link

Colormap issue between version 0.29.1 and 0.25.3 #417

Closed vpicouet closed 3 years ago

vpicouet commented 3 years ago

Hello, using the exact same code I get two different color maps between version 0.29.1 and 0.25.3. version 0.25.3: Capture d’écran, le 2021-05-04 à 08 52 44 version 0.29.1: Capture d’écran, le 2021-05-04 à 08 51 08

In the last versions I do not manage to get a meaningful colormap. I stayed in version 0.25.3 for the last few months but maybe you know how to solve the issue. I plot the mesh like this:

range_ = [np.nanpercentile(data, 30), np.nanpercentile(data, 99)]
p.add_mesh(mesh, clim=range_, scalars=data.flatten(), opacity=0.7, nan_opacity=0, use_transparency=False, name="Data", flip_scalars=True, stitle="Value") 

Thanks

akaszynski commented 3 years ago

What happens if you force rng rather than clim? Also, can you check if this bug still occurs with the master branch? If the problem exists in both cases, can you post a minimum working example so we can reproduce this locally?

vpicouet commented 3 years ago

Thanks for the quick answer, it works perfectly well in both case when I force rng instead of clim! Thanks