API¶
- class vplot.VPLOTFigure(*args, max_label_length=40, mpl_units=True, xlog=False, ylog=False, auto_legend=True, **kwargs)¶
A
vplot
figure object, a subclass ofmatplotlib.figure.Figure
.This class adds certain functionality to the default
matplotlib
figure object, in particular the ability to recognize whenvplanet
quantities are plotted. When showing / drawing / saving the figure, this class will automatically label the axes and/or add a legend with the appropriate parameter names, types, units, and correspondingvplanet
body. All of these can be overridden by setting the axes or legend labels explcitly.This class accepts all args and kwargs as
matplotlib.figure.Figure
, with support for the following additional keywords:- Parameters
max_label_length (int, optional) – If the parameter description is longer than this value, the axis will be labeled with the shorter parameter name instead. Default 40.
mpl_units (bool, optional) – Enable matplotlib units functionality? Default is True. This allows quantities of the same physical type but different units (such as
yr
andGyr
) to be plotted on the same axis; this class will handle unit conversions as needed. An error will be raised if the unit conversion fails.xlog (bool, optional) – Set the x axis scale to be logarithmic? Default False.
ylog (bool, optional) – Set the y axis scale to be logarithmic? Default False.
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, canvas=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, constrained_layout=<UNSET>, constrained_layout_pads=<UNSET>, dpi=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, figheight=<UNSET>, figwidth=<UNSET>, frameon=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, layout_engine=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, size_inches=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tight_layout=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)¶
Set multiple properties at once.
Supported properties are
- Properties:
agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: scalar or None animated: bool canvas: FigureCanvas clip_box: .Bbox clip_on: bool clip_path: Patch or (Path, Transform) or None constrained_layout: unknown constrained_layout_pads: unknown dpi: float edgecolor: color facecolor: color figheight: float figure: .Figure figwidth: float frameon: bool gid: str in_layout: bool label: object layout_engine: unknown linewidth: number mouseover: bool path_effects: .AbstractPathEffect picker: None or bool or float or callable rasterized: bool size_inches: (float, float) or float sketch_params: (scale: float, length: float, randomness: float) snap: bool or None tight_layout: unknown transform: .Transform url: str visible: bool zorder: float
- vplot.auto_plot(path='.', sysname=None, group='param', bodies=[], params=[], show=True, **kwargs)¶
Automatically plot the results of a
vplanet
run.- Parameters
sysname (str, optional) – System name. This is determined automatically, unless there are multiple runs in the same
path
. Defaults to None.path (str, optional) – Path to the directory containing the results of the
vplanet
run. Defaults to the current directory.group (str, optional) – How to group plots. Options are “param” (one plot per parameter), “type” (one plot per physical type, such as angle, length, etc.), or “none” (one plot per column in the output file). Defaults to “param”.
bodies (list, optional) – Which bodies to generate plots for. These should be specified as a list of strings (case-insensitive). Defaults to
[]
, in which case all available bodies are plotted.params (list, optional) – Which parameters to generate plots for. These should be specified as a list of strings (case-insensitive). Defaults to
[]
, in which case all available parameters are plotted.show (bool, optional) – Show the plots? Defaults to True. If False, returns the figures instead.
kwargs (optional) – Extra keyword arguments passed directly to
vplot.VPLOTFigure
.
- Returns
If
show
is False, returns a list of figures.