@@ -479,6 +479,34 @@ def get_time_scoping(self):
479479 """
480480 return self .get_label_scoping ("time" )
481481
482+ def plot (self , label_space : dict = None , ** kwargs ):
483+ """Plots the fields in the FieldsContainer for the given LabelSpace.
484+ Check the labels available for the FieldsContainer with
485+ :func:`~fields_container.FieldsContainer.labels`.
486+
487+ Parameters
488+ ----------
489+ label_space:
490+ A dictionary (LabelSpace) of labels of the :class:`FieldsContainer` with associated
491+ values to select for plotting.
492+ This is used to filter the data to plot, for example:
493+ - if ``label_space={'time': 10}``: a single time step (mandatory for transient)
494+ - if ``label_space={'complex': 0, 'part': 12}``: real part of complex data for a part
495+ See :func:`~fields_container.FieldsContainer.get_fields`.
496+ If None is given, it renders all fields available, which may not make sense.
497+ **kwargs:
498+ For more information on accepted keyword arguments, see :func:`~field.Field.plot` and
499+ :class:`~plotter.DpfPlotter`.
500+ """
501+ from ansys .dpf .core import plotter
502+ plt = plotter .DpfPlotter (** kwargs )
503+ if label_space is None :
504+ label_space = {}
505+ fields = self .get_fields (label_space = label_space )
506+ for f in fields :
507+ plt .add_field (field = f , ** kwargs )
508+ plt .show_figure (** kwargs )
509+
482510 def animate (self , save_as = None , deform_by = None , scale_factor = 1.0 , ** kwargs ):
483511 """Creates an animation based on the Fields contained in the FieldsContainer.
484512
0 commit comments