calculate_vlims
- PlasmaCalcs.plotting.plot_tools.lims.calculate_vlims(values, *, vmin=None, vmax=None, robust=False, to_dict=False, expand_flat=True)
return the calculated vmin, vmax, for all of these values.
values: array-like or list of array-like objects
the values to use for calculating the vlims.if list of array-like objects, the array-like objects may be of different shapes.vmin, vmax: None or valueif provided, use this value for vmin, vmax. Otherwise, calculate it.robust: UNSET, bool, or number between 0 and 50 (default: UNSET)use np.percentile when determining vmin/vmax, if robust.For imshow/image plots, this refers to colorbar lims; for line plots, this refers to y lims.UNSET –> use DEFAULTS.PLOT.ROBUST (default: True).False –> just use min and max of values, don’t use percentile.True –> use DEFAULTS.PLOT.ROBUST_PERCENTILE (default: 2.0)number –> use np.percentile with this percentile for vmin (and 100 - this percentile for vmax).to_dict: boolif True, return dict(vmin=vmin, vmax=vmax) instead of (vmin, vmax)expand_flat: boolif True, and computed vmin > vmax, and provided vmin or vmax but not both,then adjust the not-provided value such that vmin > vmax. I.e.:provided vmin –> use vmax = vmin + 0.05. (this matches matplotlib default when vmin=vmax)provided vmax –> use vmin = vmax - 0.05. (this matches matplotlib default when vmin=vmax)