fedoo.DataSet.plot
- DataSet.plot(field: str | None = None, component: int | str = 0, data_type: str | None = None, scale: float = 1, show: bool = True, show_edges: bool = True, clim: list[float] | None = None, node_labels: bool | list = False, element_labels: bool | list = False, show_nodes: bool | float = False, show_normals: bool | float = False, plotter: object | None = None, screenshot: str | None = None, azimuth: float = 30.0, elevation: float = 15.0, roll: float = 0, title: str | None = None, title_size: float = 18.0, window_size: list | None = None, multiplot: bool | None = None, **kargs) None
Plot a field on the surface of the associated mesh.
- Parameters:
field (str (optional)) – The name of the field to plot. If no name is given, plot only the mesh.
component (int | str, default = 0) –
The data component to plot in case of vector data. The available str components are:
’X’, ‘Y’ and ‘Z’; respectively equivalent to 0, 1 and 2 for vector components.
’XX’, ‘YY’, ‘ZZ’, ‘XY’, ‘XZ’ and ‘YZ’ are respectively equivalent to 0, 1, 2, 3, 4 and 5 for tensor using the voigt notations.
’vm’ to plot the von-mises stress from a stress field.
’pressure’ to extract the hydrostatic pressure of a stress field.
’norm’ to compute the vector euclidean norm.
data_type (str in {'Node', 'Element', 'GaussPoint'} - Optional) – The type of data to plot (defined at nodes, elements au gauss integration points). If the existing data doesn’t match to the specified one, the data are converted before plotted. For instance data_type = ‘Node’ make en average of data from adjacent elements at nodes. This allow a more smooth plot. It the type is not specified, look for any type of data and, if the data is found, draw the field without conversion.
scale (float, default = 1) – The scale factor used for the nodes displacement, using the ‘Disp’ vector field. If scale = 0, the field is plotted on the underformed shape.
show (bool, default = True) –
If show = True, the plot is rendered in a new window.
If show = False, the current pyvista plotter is returned without rendering.
show = False allow to customize the plot with pyvista before rendering it.
show_edges (bool, default = True) – if True, the mesh edges are shown
clim (sequence[float], optional) – Sequence of two float to define data boundaries for color bar. Defaults to minimum and maximum of data.
node_labels (bool | list, default = False) – If True, show node labels (node indexe) If a list is given, print the label given in node_labels[i] for each node i.
element_labels (bool | list, default = False) – If True, show element labels (element indexe) If a list is given, print the label given in element_labels[i] for each element i.
show_nodes (bool|float, default = False) – Plot the nodes. If True, the nodes are shown with a default size. If float, show_nodes is the required size.
show_normals (bool|float, default = False) – Plot the face normals. If True, the vectors are shown with a default magnitude. If float, show_normals is the required magnitude. Only available for 1D or 2D mesh.
plotter (pyvista.Plotter object or str in {'qt', 'pv'}) –
If pyvista.Plotter object, plot the mesh in the given plotter
If ‘qt’: use the background plotter of pyvistaqt (need the lib pyvistaqt)
If ‘pv’: use the standard pyvista plotter
If None: use the background plotter if available, or pyvista plotter if not.
screenshot (str, optional) – If defined, indicated a filename to save the plot.
azimuth (float, default = 30.) – Azimuth angle of the camera around the scene (not used for 2D scene)
elevation (float, default = 15.) – Elevaltion angle of the camera around the scene (not used for 2D scene).
roll (float, default = 0) – Roll angle of the camera. The default state (roll angle = 0.) is set with the y direction on the up.
title (str | None, default = None) – Title of the plot. By default the title is field name and the component is printed.
title_size (float, default = 18) – Size of the title
window_size (tuple, default = (1024, 768)) – Window size in pixels.
multiplot (bool | None, default = None) – If True, the pyvista mesh is copied to force a separated scalar bar. This is usefull when ploting several figures at the same time. If multiplot si False, the same scalarbar will be applied to all the plots. If None, uses separated scalarbars only if the pyvista plotter uses subplot.
- **kwargs: dict
See pyvista.Plotter.add_mesh() in the document of pyvista for additional usefull options.