plot_contour#

ResultData.plot_contour(display_option: str = 'time', option_id: int = 1, **kwargs)#

Plot the contour result on its mesh support.

The obtained figure depends on the support, which can be a meshed region or a time frequency support. For a transient analysis, this method plots the last result if no time scoping is specified. To return a string containing all label spaces, use the self.get_all_label_spaces() method.

Parameters:
  • display_option (str, default: 'time') – Name of the label to display.

  • option_id (int, default: 1) – Label ID to display.

  • **kwargs – Additional keyword arguments for the plotter. For keyword arguments, see help(pyvista.plot).

Examples

Plot a result at time step number 1.

>>> from ansys.dpf import post
>>> from ansys.dpf.post import examples
>>> solution = post.load_solution(examples.download_all_kinds_of_complexity())
>>> stress = solution.stress(location=post.locations.nodal)
>>> sx = stress.xx
>>> pl = sx.plot_contour("time", [1], off_screen=True)  

Obtain labels.

>>> sx.get_all_label_spaces() 
[{'...': ..., '...': ...}, {'...': ..., '...': ...}]