desc.plotting.plot_qs_error

desc.plotting.plot_qs_error(eq, log=True, fB=True, fC=True, fT=True, helicity=(1, 0), rho=None, ax=None, return_data=False, **kwargs)[source]

Plot quasi-symmetry errors f_B, f_C, and f_T as normalized flux functions.

Parameters:
  • eq (Equilibrium) – Object from which to plot.

  • log (bool, optional) – Whether to use a log scale.

  • fB (bool, optional) – Whether to include the Boozer coordinates QS error.

  • fC (bool, optional) – Whether to include the flux function QS error.

  • fT (bool, optional) – Whether to include the triple product QS error.

  • helicity (tuple, int) – Type of quasi-symmetry (M, N).

  • rho (int or ndarray, optional) – Radial coordinates of the flux surfaces to evaluate at, or number of surfaces in (0,1]

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

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

  • **kwargs (fig,ax and plotting properties) –

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

    plot_X(figsize=(4,6))
    

    Valid keyword arguments are:

    figsize: tuple of length 2, the size of the figure (to be passed to matplotlib) ls: list of strs of length 3, linestyles to use for the 3 different qs metrics colors: list of strs of length 3, colors to use for the 3 different qs metrics markers: list of strs of length 3, markers to use for the 3 different qs metrics labels: list of strs of length 3, labels to use for the 3 different qs metrics ylabel: str, ylabel to use for plot legend: bool, whether to display legend or not legend_kw: dict, any keyword arguments to be pased to ax.legend()

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 plot_data keys: each are arrays of length num_rho

    ”f_T”: QS triple product metric “f_B”: Boozer QS metric (sum of symmetry-breaking modes) “f_C”: QS two-term metric “rho”

Examples

../../_images/plot_qs_error.png
from desc.plotting import plot_qs_error
fig, ax = plot_qs_error(eq, helicity=(1, eq.NFP), log=True)