The startup_code.py module#

Summary#

save_plot

Save the PyVista plot to file and return as base64.

save_matplotlib_plot

Return the current Matplotlib plot as a base64-encoded PNG image.

Description#

Startup code for PyMechanical persistent Python session.

This module contains helper functions and configurations that are loaded when the persistent Python session starts.

Module detail#

startup_code.save_plot(plotter) str#

Save the PyVista plot to file and return as base64.

Parameters:
plotterpv.Plotter

PyVista plotter to save.

Returns:
str

Base64 data URI of the plot.

startup_code.save_matplotlib_plot(dpi=150)#

Return the current Matplotlib plot as a base64-encoded PNG image.

Parameters:
dpiint

Resolution in dots per inch.

Returns:
str

Base64 data URI of the plot.

startup_code.MATPLOTLIB_AVAILABLE = True#
startup_code.PYVISTA_AVAILABLE = True#