The plotter.py module#

Summary#

DpfPlotter

DpfPlotter class. Can be used in order to plot results over a mesh.

Plotter

Plots fields and meshed regions in DPF-Core.

plot_chart

Plot the minimum/maximum result values over time.

Description#

Plotter.

This module contains the DPF plotter class.

Contains classes used to plot a mesh and a fields container using PyVista.

Module detail#

plotter.plot_chart(fields_container, off_screen=False, screenshot=None)#

Plot the minimum/maximum result values over time.

This is a valid method if time_freq_support contains several time_steps, such as in a transient analysis.

Parameters:
  • fields_container (dpf.core.FieldsContainer) – Fields container that must contains a result for each time step of time_freq_support.

  • off_screen (bool, optional) – Whether to render the image off-screen. Useful for batch workflows. The default is False.

  • screenshot (path-like, optional) – A file path to which the figure should be saved. The format is inferred from the file extension in the path (defaults to “.png”). The default is None.

Examples

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> model = dpf.Model(examples.find_transient_therm())
>>> t = model.results.temperature.on_all_time_freqs()
>>> fc = t.outputs.fields_container()
>>> plotter = dpf.plotter.plot_chart(fc)