desc.plotting.plot_boozer_modes
- desc.plotting.plot_boozer_modes(eq, log=True, B0=True, norm=False, num_modes=10, rho=None, helicity=None, max_only=False, ax=None, return_data=False, **kwargs)Source
Plot Fourier harmonics of \(|B|\) in Boozer coordinates.
- Parameters:
eq (Equilibrium) – Object from which to plot.
log (bool, optional) – Whether to use a log scale.
B0 (bool, optional) – Whether to include the m=n=0 mode.
norm (bool, optional) – Whether to normalize the magnitudes such that B0=1 Tesla.
num_modes (int, optional) – How many modes to include. Use -1 for all modes.
rho (int or ndarray, optional) – Radial coordinates of the flux surfaces to evaluate at, or number of surfaces in (0,1]
helicity (None or tuple of int) – If a tuple, the (M,N) helicity of the field, only symmetry breaking modes are plotted. If None, plot all modes.
max_only (bool) – If True, only plot the maximum of the symmetry breaking modes. Helicity must be specified.
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))
Valid keyword arguments are:
figsize
: tuple of length 2, the size of the figure (to be passed to matplotlib)lw
: float, linewidthls
: str, linestylelegend
: bool, whether to display legend or notlegend_kw
: dict, any keyword arguments to be passed to ax.legend()xlabel_fontsize
: float, fontsize of the xlabelylabel_fontsize
: float, fontsize of the ylabellabel
: str, label to apply. Only used ifmax_only
is True.color
: str, color for plotted line. Only used ifmax_only
is True.M_booz
: int, poloidal resolution to use for Boozer transform.N_booz
: int, toroidal resolution to use for Boozer transform.
- 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
from desc.plotting import plot_boozer_modes fig, ax = plot_boozer_modes(eq)