show

Chart2D.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 in pyvista.global_theme.full_screen.

full_screenbool, optional

Opens window in full screen. When enabled, ignores window_size. Defaults to active theme setting in pyvista.global_theme.full_screen.

screenshotstr or bool, optional

Saves screenshot to file when enabled. See: Plotter.screenshot(). Default False.

When True, takes screenshot and returns numpy array of image.

window_sizelist, 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.

backgroundstr or 3 item list, 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, 1, 1], or color='#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 2D chart and show it.

>>> import pyvista
>>> chart = pyvista.Chart2D()
>>> plot = chart.line([0, 1, 2], [2, 1, 3])
>>> chart.show()
../../../../_images/pyvista-Chart2D-show-1_00_00.png