show#
- ChartBox.show(off_screen=None, full_screen=None, screenshot=None, window_size=None, notebook=None, background='w')#
Show this chart in a self contained plotter.
- Parameters
- off_screenbool
Plots off screen when
True
. Helpful for saving screenshots without a window popping up. Defaults to active theme setting inpyvista.global_theme.full_screen
.- full_screenbool,
optional
Opens window in full screen. When enabled, ignores
window_size
. Defaults to active theme setting inpyvista.global_theme.full_screen
.- screenshot
str
or bool,optional
Saves screenshot to file when enabled. See:
Plotter.screenshot()
. DefaultFalse
.When
True
, takes screenshot and returnsnumpy
array of image.- window_size
list
,optional
Window size in pixels. Defaults to global theme
pyvista.global_theme.window_size
.- notebookbool,
optional
When
True
, the resulting plot is placed inline a jupyter notebook. Assumes a jupyter console is active.- background
color_like
,optional
Use to make the entire mesh have a single solid color. Either a string, RGB list, or hex color string. For example:
color='white'
,color='w'
,color=[1.0, 1.0, 1.0]
, orcolor='#FFFFFF'
. Defaults to'w'
.
- Returns
np.ndarray
Numpy array of the last image when
screenshot=True
is set. Optionally contains alpha values. Sized:[Window height x Window width x 3] if the theme sets
transparent_background=False
.[Window height x Window width x 4] if the theme sets
transparent_background=True
.
Examples
Create a simple boxplot chart and show it.
>>> import pyvista >>> chart = pyvista.ChartBox([[0, 1, 1, 2, 3, 3, 4]]) >>> chart.show()