desc.plotting.plot_boozer_surface

desc.plotting.plot_boozer_surface(thing, grid_compute=None, grid_plot=None, rho=1, fill=False, ncontours=30, fieldlines=0, ax=None, return_data=False, **kwargs)Source

Plot \(|B|\) on a surface vs the Boozer poloidal and toroidal angles.

Parameters:
  • thing (Equilibrium or OmnigenousField) – Object from which to plot.

  • grid_compute (Grid, optional) – grid to use for computing boozer spectrum

  • grid_plot (Grid, optional) – grid to plot on

  • rho (float, optional) – Radial coordinate of flux surface. Used only if grids are not specified.

  • fill (bool, optional) – Whether the contours are filled, i.e. whether to use contourf or contour.

  • ncontours (int, optional) – Number of contours to plot.

  • fieldlines (int, optional) – Number of (linearly spaced) magnetic fieldlines to plot. Default is 0 (none).

  • ax (matplotlib AxesSubplot, optional) – Axis to plot on.

  • return_data (bool) – if True, return the data plotted as well as fig,ax

  • **kwargs (dict, optional) –

    Specify properties of the figure, axis, and plot appearance e.g.:

    plot_X(figsize=(4,6),cmap="plasma")
    

    Valid keyword arguments are:

    • iota: rotational transform, used when thing is an OmnigenousField

    • figsize: tuple of length 2, the size of the figure (to be passed to matplotlib)

    • cmap: str, matplotlib colormap scheme to use, passed to ax.contourf

    • levels: int or array-like, passed to contourf

    • title_fontsize: integer, font size of the title

    • xlabel_fontsize: float, fontsize of the xlabel

    • ylabel_fontsize: float, fontsize of the ylabel

Returns:

  • fig (matplotlib.figure.Figure) – figure being plotted to

  • ax (matplotlib.axes.Axes or ndarray of Axes) – axes being plotted to

  • plot_data (dict) – dictionary of the data plotted, only returned if return_data=True

Examples

../../_images/plot_boozer_surface.png
from desc.plotting import plot_boozer_surface
fig, ax = plot_boozer_surface(eq)
../../_images/plot_omnigenous_field.png
from desc.plotting import plot_boozer_surface
fig, ax = plot_boozer_surface(field, iota=0.32)