desc.plotting.plot_1d
- desc.plotting.plot_1d(eq, name, grid=None, log=False, normalize=None, ax=None, return_data=False, compute_kwargs=None, **kwargs)Source
Plot 1D profiles.
- Parameters:
eq (Equilibrium, Surface, Curve) – 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.
normalize (str, optional) – Name of the variable to normalize
nameby. Default is None.ax (matplotlib AxesSubplot, optional) – Axis to plot on.
return_data (bool) – If True, return the data plotted as well as fig,ax
compute_kwargs (dict, optional) – Additional keyword arguments to pass to
eq.compute.**kwargs (dict, optional) –
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 xlabelylabel_fontsize: float, fontsize of the ylabelcolor: str or tuple, color to use for plot linels: str, linestyle to use for plot linelw: 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
Examples
from desc.plotting import plot_1d plot_1d(eq, 'p')