desc.plotting.plot_1d
- desc.plotting.plot_1d(eq, name, grid=None, log=False, ax=None, return_data=False, **kwargs)[source]
Plot 1D profiles.
- Parameters:
eq (Equilibrium) – Object from which to plot.
name (str) – Name of variable to plot.
grid (Grid, optional) – Grid of coordinates to plot at.
log (bool, optional) – Whether to use a log scale.
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),label="your_label")
Valid keyword arguments are:
figsize: tuple of length 2, the size of the figure (to be passed to matplotlib) component: str, one of [None, ‘R’, ‘phi’, ‘Z’], For vector variables, which
element to plot. Default is the norm of the vector.
label: str, label of the plotted line (e.g. to be shown with ax.legend()) xlabel_fontsize: float, fontsize of the xlabel ylabel_fontsize: float, fontsize of the ylabel linecolor: str or tuple, color to use for plot line ls: str, linestyle to use for plot line lw: float, linewidth to use for plot line
- 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:
”rho”,”theta” or “zeta”, depending on what 1-D variable is plotted against key of the name of variable plotted
Examples
from desc.plotting import plot_1d plot_1d(eq, 'p')