xbout.plotting.plotfuncs.plot2d_wrapper#
- xbout.plotting.plotfuncs.plot2d_wrapper(da, method, *, ax=None, separatrix=True, targets=True, add_limiter_hatching=True, gridlines=None, cmap=None, norm=None, logscale=None, vmin=None, vmax=None, aspect=None, extend=None, **kwargs)[source]#
Make a 2D plot using an xarray method, taking into account branch cuts (X-points).
Wraps
xarray.DataArray.plot
methods, so automatically adds labels.- Parameters:
da (
xarray.DataArray
) – A 2D (x,y) DataArray of data to plotmethod (
xarray.plot.*
) – An xarray plotting method to useax (
Axes
, optional) – A matplotlib axes instance to plot to. If None, create a new figure and axes, and plot to thatseparatrix (
bool
, optional) – Add dashed lines showing separatricestargets (
bool
, optional) – Draw solid lines at the target surfacesadd_limiter_hatching (
bool
, optional) – Draw hatched areas at the targetsgridlines (
bool
,int
orslice
ordict
ofbool
,int
orslice
, optional) – If True, draw grid lines on the plot. If an int is passed, it is used as the stride when plotting grid lines (to reduce the number on the plot). If a slice is passed it is used to select the grid lines to plot. If a dict is passed, the ‘x’ entry (bool, int or slice) is used for the radial grid-lines and the ‘y’ entry for the poloidal grid lines.cmap (
Matplotlib colormap
, optional) – Color map to use for the plotnorm (
matplotlib.colors.Normalize instance
, optional) – Normalization to use for the color scale. Cannot be set at the same time as ‘logscale’logscale (
bool
orfloat
, optional) – If True, default to a logarithmic color scale instead of a linear one. If a non-bool type is passed it is treated as a float used to set the linear threshold of a symmetric logarithmic scale as linthresh=min(abs(vmin),abs(vmax))*logscale, defaults to 1e-5 if True is passed. Cannot be set at the same time as ‘norm’vmin (
float
, optional) – Minimum value for the color scalevmax (
float
, optional) – Maximum value for the color scaleaspect (
str
orfloat
, optional) – Passed to ax.set_aspect(). By default ‘equal’ is used.levels (
int
oriterable
, optional) – Only used by contour or contourf, sets the number of levels (if int) or the level values (if iterable)**kwargs (optional) – Additional arguments are passed on to method
- Returns:
List of the artist instances
- Return type:
artists