You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of expected behavior and the observed behavior
Cells with NaN values should be colored according to the provided nan_color kwarg. However, they always default to a redish color. I believe this is a follow up from #6627, where the color mapping was fixed, except for handling NaN colors.
Screenshots or screencasts of the bug in action
No bug
Bug
Software version info
No bug
Bug
panel==1.3.8
panel==1.4.1
bokeh==3.3.4
bokeh==3.4.1
pyvista==0.43.5
pyvista==0.43.5
Complete, minimal, self-contained example code that reproduces the issue
importpyvistaaspvimportpanelaspnimportnumpyasnppn.extension("vtk")
## Initialize a plotter objectplotter=pv.Plotter(window_size=[400, 400])
## Create a meshmesh=pv.Sphere(radius=1.0)
## Associate a scalar field to the meshz=mesh.cell_centers().points.T[2]
mesh["myscalar"] =np.where(z<0.7, z, np.nan)
## Add mesh to the plotterplotter.add_mesh(
mesh, scalars="myscalar", cmap="viridis", show_edges=True, nan_color="magenta"
)
## Some final touchesplotter.background_color="white"plotter.view_isometric()
plotter.add_title(f"Using panel=={pn.__version__}")
## Pass plotter to panelsphere_pan=pn.panel(plotter.ren_win, width=400, orientation_widget=True)
## Export as HTMLwithopen(f"sphere_pan_{pn.__version__}.html", 'w') asf:
sphere_pan.save(f)
This is perhaps related: the above_color and below_color values are also ignored.
No bug
Bug
Code:
importpyvistaaspvimportpanelaspnpn.extension("vtk")
## Initialize a plotter objectplotter=pv.Plotter(window_size=[400, 400])
## Create a meshmesh=pv.Sphere(radius=1.0)
## Associate a scalar field to the meshz=mesh.cell_centers().points.T[2]
mesh["myscalar"] =z## Add mesh to the plotterplotter.add_mesh(
mesh,
scalars="myscalar",
cmap="viridis",
show_edges=True,
clim=[-0.5, 0.5],
above_color="magenta",
below_color="orange",
)
## Some final touchesplotter.background_color="white"plotter.view_isometric()
plotter.add_title(f"Using panel=={pn.__version__}")
## Pass a plotter to panelsphere_pan=pn.panel(plotter.ren_win, width=400, orientation_widget=True)
## Export as HTMLwithopen(f"sphere_pan_{pn.__version__}.html", 'w') asf:
sphere_pan.save(f)
Description of expected behavior and the observed behavior
Cells with NaN values should be colored according to the provided nan_color kwarg. However, they always default to a redish color. I believe this is a follow up from #6627, where the color mapping was fixed, except for handling NaN colors.
Screenshots or screencasts of the bug in action
Software version info
Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
With panel==1.4.1:
The text was updated successfully, but these errors were encountered: