Coloring by scalar not working in 0.33.3
See original GitHub issueI updated to Pyvista 0.33.3 today, from 0.31.3. I still use the same VTK build.
I have the following small plotting script:
pv.set_plot_theme("document")
plotter = pv.Plotter(window_size=[1920, 1200])
plotter.add_mesh(grid, scalars='array', style="points", categories=True)
_ = plotter.add_axes(line_width=5)
plotter.camera_position = 'iso'
plotter.show(screenshot='probes.png', auto_close=False)
plotter.close()
that previously (0.31.3) produced this plot:
With 0.33.3 the result is:
I.e. the coloring by the scalar ‘array’ does not work. The colorbar is scaled correctly, though. I attach a complete input file and plot script here: pyvista-probes.tar.gz
System Information:
0.31.3:
--------------------------------------------------------------------------------
Date: Wed Mar 16 14:22:42 2022 UTC
OS : Linux
CPU(s) : 16
Machine : x86_64
Architecture : 64bit
RAM : 62.6 GiB
Environment : Python
GPU Vendor : Mesa/X.org
GPU Renderer : llvmpipe (LLVM 12.0.1, 256 bits)
GPU Version : 4.5 (Core Profile) Mesa 21.3.0
Python 3.8.11 (default, Sep 1 2021, 12:33:46) [GCC 9.3.1 20200408 (Red Hat
9.3.1-2)]
pyvista : 0.31.3
vtk : 9.1.20211118
numpy : 1.21.4
imageio : 2.13.3
appdirs : 1.4.4
scooby : 0.5.9
meshio : 4.4.6
matplotlib : 3.4.3
colorcet : 3.0.0
scipy : 1.7.3
--------------------------------------------------------------------------------
0.33.3:
--------------------------------------------------------------------------------
Date: Wed Mar 16 14:22:23 2022 UTC
OS : Linux
CPU(s) : 16
Machine : x86_64
Architecture : 64bit
RAM : 62.6 GiB
Environment : Python
GPU Vendor : Mesa/X.org
GPU Renderer : llvmpipe (LLVM 12.0.1, 256 bits)
GPU Version : 4.5 (Core Profile) Mesa 21.3.0
Python 3.8.11 (default, Sep 1 2021, 12:33:46) [GCC 9.3.1 20200408 (Red Hat
9.3.1-2)]
pyvista : 0.33.3
vtk : 9.1.20211118
numpy : 1.22.3
imageio : 2.16.1
appdirs : 1.4.4
scooby : 0.5.12
matplotlib : 3.4.3
colorcet : 3.0.0
scipy : 1.8.0
--------------------------------------------------------------------------------
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Releases · pyvista/pyvista - GitHub
... Resolve issues with scalars in cell_data_to_point_data API docs by @RobPasMue in #3011 ... Unified Color class and color_like type. by @dcbr in...
Read more >color_by scalars not working - Web Support - ParaView
I have added two scalars to this data and they can be seen in Glance. The question is why I don't see the...
Read more >Shape-Out 2 Documentation
Shape-Out 2 can be installed via multiple channels. 1. Windows installer: Download the latest version for your architecture (i.e..
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re right. When you load it it’s indeed not in
grid.point_data
:Looks like it’s added by the plotter, because it indeed shows up after adding it with
add_mesh
This is why I would have prefered to have
copy_mesh=True
, these sorts of weird edge cases that crop up.This is still a weird bug, and I think it has to do with the fact that
n_cells
==n_points
and we have some bad logic somewhere in there.Ok, further update: The first commit to introduce the bug is https://github.com/pyvista/pyvista/commit/d8a8873d84c41a44f3e08d7468233e9b73f61122
Huge commit so it’s not trivial to spot the issue…