xbout.plotting.plotfuncs.plot2d_polygon

xbout.plotting.plotfuncs.plot2d_polygon(da, ax=None, cax=None, cmap='viridis', norm=None, logscale=False, antialias=False, vmin=None, vmax=None, extend='neither', add_colorbar=True, colorbar_label=None, separatrix=True, separatrix_kwargs={'color': 'white', 'linestyle': '-', 'linewidth': 2}, targets=False, add_limiter_hatching=False, grid_only=False, linewidth=0, linecolor='black')[source]

Nice looking 2D plots which have no visual artifacts around the X-point.

Parameters:
  • da (xarray.DataArray) – A 2D (x,y) DataArray of data to plot

  • ax (Axes, optional) – Axes to plot on. If not provided, will make its own.

  • cax (Axes, optional) – Axes to plot colorbar on. If not provided, will plot on the same axes as the plot.

  • cmap (str or matplotlib.colors.Colormap, default "viridis") – Colormap to use for the plot

  • norm (matplotlib.colors.Normalize, optional) – Normalization to use for the color scale

  • logscale (bool, default False) – If True, use a symlog color scale

  • antialias (bool, default False) – Enables antialiasing. Note: this also shows mesh cell edges - it’s unclear how to disable this.

  • vmin (float, optional) – Minimum value for the color scale

  • vmax (float, optional) – Maximum value for the color scale

  • extend (str, optional, default "neither") – Extend the colorbar. Options are “neither”, “both”, “min”, “max”

  • add_colorbar (bool, default True) – Enable colorbar in figure?

  • colorbar_label (str, optional) – Label for the colorbar

  • separatrix (bool, default True) – Add lines showing separatrices

  • separatrix_kwargs (dict) – Keyword arguments to pass custom style to the separatrices plot

  • targets (bool, default True) – Draw solid lines at the target surfaces

  • add_limiter_hatching (bool, default True) – Draw hatched areas at the targets

  • grid_only (bool, default False) – Only plot the grid, not the data. This sets all the polygons to have a white face.

  • linewidth (float, default 0) – Width of the gridlines on cell edges

  • linecolor (str, default "black") – Color of the gridlines on cell edges