ogstools.plot.utils module#
- ogstools.plot.utils.justified_labels(points)[source]#
Formats an array of points to a list of aligned str.
- ogstools.plot.utils.label_spatial_axes(fig, axes, x_var, y_var)[source]#
Add labels to x and y axis.
If given an array of axes, only the outer axes will be labeled.
- Return type:
- ogstools.plot.utils.label_ax(fig, ax, x_label, y_label, fontsize=None)[source]#
Labels the x- and y-Axes according to the given Variables.
Accounts for shared axes and if that’s the case, only the first axes in a row or column will be labeled.
- Return type:
- ogstools.plot.utils.update_font_sizes(axes, fontsize=None)[source]#
Update font sizes of labels and texts.
This also scales the ticks accordingly.
- ogstools.plot.utils.get_data_aspect(mesh)[source]#
Calculate the data aspect ratio of a 2D mesh.
- Return type:
- ogstools.plot.utils.save_animation(anim, filename, fps)[source]#
Save a FuncAnimation with some codec presets.
- Parameters:
anim (
FuncAnimation) – the FuncAnimation to be savedfilename (
str) – the name of the resulting filefps (
int) – the number of frames per second
- Return type:
- ogstools.plot.utils.get_cmap_norm(levels, variable, **kwargs)[source]#
Construct a discrete colormap and norm for the variable field.
- ogstools.plot.utils.contrast_color(color)[source]#
Return black or white - whichever has more contrast to color.