ogstools.meshplotlib.plot_setup module#
Plot configuration setup.
- class ogstools.meshplotlib.plot_setup.PlotSetup[source]#
Bases:
object
Configuration class for easy plot adjustments.
Each entry has a default value as listed in
ogstools.meshplotlib.plot_setup_defaults
.- combined_colorbar: bool#
True if all subplots share on colorbar, else each has its own colorbar.
- custom_cmap: Colormap#
If provided, this colormap will be used for any plot.
- cmap_dict_if_bilinear: dict#
A dictionary that maps bilinear colormaps to properties.
- cmap_dict: dict#
A dictionary that maps colormaps to properties.
- cmap_if_mask: list#
A list of colors corresponding to [True, False] values of masks.
- default_cmap: str#
The default colormap to use.
- dpi: int#
The resolution (dots per inch) for the figure.
- fig_scale: float#
A scaling factor for the figure.
- ax_aspect_limits: tuple[float, float]#
Lower and upper limit of the ax aspect ratio. For meshes with data ratios
- fig_aspect_limits: tuple[float, float]#
Lower and upper limit of the figure aspect ratio. If a figure would exceed
- invert_colorbar: bool#
A boolean indicating whether to invert the colorbar.
- layout: str#
Layout of the figure
- material_names: dict#
A dictionary that maps material names to regions (MaterialIDs).
- num_levels: int#
The aimed number of levels / bins of the colorbar. See
ogstools.meshplotlib.levels
- num_streamline_interp_pts: int#
The number of interpolation points for streamlines.
- __init__(combined_colorbar, custom_cmap, cmap_dict_if_bilinear, cmap_dict, cmap_if_mask, default_cmap, dpi, fig_scale, ax_aspect_limits, fig_aspect_limits, invert_colorbar, layout, length, material_names, num_levels, num_streamline_interp_pts, p_max, p_min, rcParams, show_element_edges, title_center, title_left, title_right, x_label, y_label, log_scaled, show_region_bounds, embedded_region_names_color)#
- Parameters:
combined_colorbar (bool) –
custom_cmap (Colormap) –
cmap_dict_if_bilinear (dict) –
cmap_dict (dict) –
cmap_if_mask (list) –
default_cmap (str) –
dpi (int) –
fig_scale (float) –
ax_aspect_limits (tuple[float, float]) –
fig_aspect_limits (tuple[float, float]) –
invert_colorbar (bool) –
layout (str) –
length (Scalar) –
material_names (dict) –
num_levels (int) –
num_streamline_interp_pts (int) –
p_max (float) –
p_min (float) –
rcParams (dict) –
show_element_edges (bool | str) –
title_center (str) –
title_left (str) –
title_right (str) –
x_label (str) –
y_label (str) –
log_scaled (bool) –
show_region_bounds (bool) –
embedded_region_names_color (str) –
- Return type:
None
- p_max: float#
The fixed upper limit for the current scale.
- p_min: float#
The fixed lower limit for the current scale.
- rcParams: dict#
Matplotlib runtime configuration. See
ogstools.meshplotlib.plot_setup_defaults
- show_element_edges: bool | str#
Controls the display of element edges, can be a boolean or ‘str’. In the latter case element edges are always shown for if the name matches the property data name.
- title_center: str#
The center part of the plot’s title.
- title_left: str#
The left part of the plot’s title.
- title_right: str#
The right part of the plot’s title.
- x_label: str#
The label for the x-axis.
- y_label: str#
The label for the y-axis.
- log_scaled: bool#
A boolean indicating whether the scaling should be logarithmic.
- show_region_bounds: bool#
Controls the display of region (MaterialIDs) edges.
- embedded_region_names_color: str#
Color of the embedded region names inside the plot.
- cmap_str(property)[source]#
Get the colormap string for a given property.
- Parameters:
property (Property) –
- Return type:
str | list
- property rcParams_scaled: dict#
Get the scaled rcParams values.