PlasmaCalcs.plotting.patches.LimsPatchPlotElement

class PlasmaCalcs.plotting.patches.LimsPatchPlotElement(params, *, ax=None, transform=UNSET, **kw_super)

Bases: RectanglePatchPlotElement

plot a rectangle patch, from xmin, xmax, ymin, ymax, instead of x0, y0, width, height.
params: dict
dict of any rectangle patch related parameters.
must contain (‘xmin’ and ‘xmax’) and/or (‘ymin’ and ‘ymax’).
units determined by transform; default ‘data’ units.
if xlims not provided, transform[0] must allow ‘axes’ units (will put 0 to 1, i.e. fill horizontally)
if ylims not provided, transform[1] must allow ‘axes’ units (will put 0 to 1, i.e. fill vertically)
(if transform restricted above but not input directly,
default to ‘axes’ units where necessary, and ‘data’ units elsewhere.)
transform: UNSET, ‘data’, ‘axes’, 2-tuple of (‘data’ or ‘axes’), or Transform object (default: UNSET)
indicate coordinate system to use for x and y inputs.
single string –> x and y both in this coordinate system.
tuple –> xy[0] tells x system; xy[1] tells y system.
‘data’ coords means input values match data values.
‘axes’ coords means input values correspond to distance across axis:
for x: left=0, right=1.
for y: bottom=0, top=1.
See also: XarrayLimsPatch, RectanglePatchPlotElement
To view or adjust plot settings in self, see self.plot_settings, or help(self.plot_settings).
__init__(params, *, ax=None, transform=UNSET, **kw_super)

Methods

__init__(params, *[, ax, transform])

init_patch()

legend_handle(*[, hatch_density_scaling, label])

update_data(data)

Attributes

MPL_SETTERS

PATCH_SETTINGS_LOOKUP

ax

fig

params

patch

property ax
the axes containing this patch
property fig
the figure containing this patch
init_patch()
initialize the patch; actually draw the patch on self.ax.
stores plotted object in self.patch and returns self.patch.
legend_handle(*, hatch_density_scaling=2, label=UNSET)
returns a Patch suitable for use as a handle in a legend.
hatch_density_scaling: int
increase the hatch density by this factor, relative to the plot itself, if using hatches.
label: UNSET or str
if not UNSET, use this as the label, instead of self.plot_settings[‘label’]
Example:
handle1 = self.legend_handle()
handle2 = other_patch_element.legend_handle()
plt.legend(handles=[handle1, handle2])
property params
dict of patch parameters. Internally, stored at self.data[‘params’]
property patch
the matplotlib.patches.Patch object
patch_cls

alias of Rectangle

update_data(data)
updating the plot using data[‘params’].
return the list of all updated matplotlib Artist objects (i.e., [self.patch])