Plots#

class ansys.fluent.visualization.matplotlib.matplot_objects.Plots(session, local_surfaces_provider=None)#

Provides the Matplotlib Plots objects manager.

This class provides access to Plots object containers for a given session so that plots can be created.

Parameters
sessionobj

Session object.

local_surfaces_providerobject, optional

Object providing local surfaces so that you can access surfaces created in other modules, such as PyVista. The default is None.

Attributes
XYPlotsdict

Container for XY plot objects.

MonitorPlotsdict

Container for monitor plot objects.

In the following example, a Plots object is instantiated with a Fluent session as its context. The Plots object is used to generate and plot two XY plots and a monitor plot.

from ansys.fluent.visualization.matplotlib import Plots

plots_session = Plots(session)
plot1 = plots_session.XYPlots["plot-1"]
plot1.surfaces_list = ['symmetry', 'wall']
plot1.y_axis_function = "temperature"
plot1.plot("window-0")


#To plot data on local surface created in PyVista

from ansys.fluent.visualization.pyvista import  Graphics
pyvista_surface_provider = Graphics(session).Surfaces
plots_session = Plots(session, pyvista_surface_provider)
plot2 = plots_session.XYPlots["plot-2"]
plot2.surfaces_list = ['iso-surface-1']
plot2.y_axis_function = "temperature"
plot2.plot("window-0")


#To plot monitors

monitor1=plots_session.Monitors["monitor-1"]
monitor1.monitor_set_name = "residual"
monitor1.plot("window-0")