ogstools.meshplotlib.plot_features module#

Specialized plot features.

ogstools.meshplotlib.plot_features.plot_layer_boundaries(ax, surf, projection)[source]#

Plot the material boundaries of a surface on a matplotlib axis.

Parameters:
  • ax (Axes)

  • surf (DataSet)

  • projection (int)

Return type:

None

ogstools.meshplotlib.plot_features.plot_element_edges(ax, surf, projection)[source]#

Plot the element edges of a surface on a matplotlib axis.

Parameters:
  • ax (Axes)

  • surf (DataSet)

  • projection (int)

Return type:

None

ogstools.meshplotlib.plot_features.plot_streamlines(ax, mesh, mesh_property, projection=None, plot_type='streamlines')[source]#

Plot the vector streamlines or arrows on a matplotlib axis.

Parameters:
  • ax (Axes) – Matplotlib axis to plot onto

  • mesh (DataSet) – Mesh containing the vector property

  • mesh_property (Vector) – Vector property to visualize

  • projection (int | None) – Index of flat dimension (e.g. 2 for z axis), gets automatically determined if not given

  • plot_type (Literal['streamlines', 'arrows', 'lines']) – Whether to plot streamlines, arrows or lines.

Return type:

None

ogstools.meshplotlib.plot_features.plot_on_top(ax, surf, contour, scaling=1.0)[source]#
Parameters:
  • ax (Axes)

  • surf (DataSet)

  • contour (Callable[[ndarray], ndarray])

  • scaling (float)

Return type:

None

ogstools.meshplotlib.plot_features.plot_contour(ax, mesh, style, lw, projection=2)[source]#
Parameters:
  • ax (Axes)

  • mesh (DataSet)

  • style (str)

  • lw (int)

  • projection (int)

Return type:

None

ogstools.meshplotlib.plot_features.plot_profile(mesh, properties, profile_points, profile_plane=(0, 1), resolution=None, plot_nodal_pts=True, nodal_pts_labels=None)[source]#

Default plot for the data obtained from sampling along a profile on a mesh.

Parameters:
  • mesh (UnstructuredGrid) – Mesh providing the data

  • props – Properties to be read from the mesh

  • profile_points (ndarray) – Points defining the profile (and its segments)

  • resolution (int | None) – Resolution of the sampled profile. Total number of points within all profile segments.

  • plot_nodal_pts (bool | None) – Plot and annotate all nodal points in profile

  • nodal_pts_labels (str | list | None) – Labels for nodal points (only use if plot_nodal_points is set to True)

  • twinx – Enable plotting second property on twin-x axis (only works if exactly two properties are provided in props param)

  • profile_plane (tuple | list) – Define which coordinates to use if profile plane is different than XY: [0, 2] for XZ, [1, 2] for YZ…

  • properties (str | list | Property)

Returns:

Tuple containing Matplotlib Figure and Axis objects

Return type:

tuple[Figure, Axes]

ogstools.meshplotlib.plot_features.lineplot(x, y, mesh, profile_points, ax=None, fontsize=20, twinx=False, resolution=100)[source]#

Plot selected properties obtained from sample_over_polyline function, this function calls to it internally. Values provided in param x and y refer to columns of the DataFrame returned by it.

Parameters:
  • x (str) – Value to be used on x-axis of the plot

  • y (str | Property | list | ndarray) – Values to be used on y-axis of the plot

  • mesh (UnstructuredGrid) – Mesh to be sampled

  • profile_points (ndarray) – Points defining the profile (and its segments)

  • ax (axes | None) – User-created array of Matplotlib axis object

  • resolution (int | None) – Resolution of the sampled profile. Total number of points within all profile segments.

  • fontsize (int) – Font size to be used for all captions and labels in the plot

  • twinx (bool | None) – Enable plotting second property on twin-x axis (only works if exactly two properties are provided in props param)

  • resolution – Resolution of the sampled profile. Total number of points within all profile segments.

Returns:

Matplotlib Axes object

Return type:

axes