desc.plotting.poincare_plot
- desc.plotting.poincare_plot(field, R0, Z0, ntransit=100, phi=None, NFP=None, grid=None, ax=None, return_data=False, **kwargs)Source
Poincare plot of field lines from external magnetic field.
- Parameters:
field (MagneticField) – External field, coilset, current potential etc to plot from.
R0 (array-like) – Starting points at phi=0 for field line tracing.
Z0 (array-like) – Starting points at phi=0 for field line tracing.
ntransit (int) – Number of transits to trace field lines for.
phi (float, int or array-like or None) – Values of phi to plot section at. If an integer, plot that many contours linearly spaced in (0,2pi). Default is 6.
NFP (int, optional) – Number of field periods. By default attempts to infer from
field, otherwise uses NFP=1.grid (Grid, optional) – Grid used to discretize
field.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)color: str or tuple, color to use for field lines.marker: str, markerstyle to use for the plotted pointssize: float, markersize to use for the plotted pointstitle_fontsize: integer, font size of the titlexlabel_fontsize: float, fontsize of the xlabelylabel_fontsize: float, fontsize of the ylabel
Additionally, any other keyword arguments will be passed on to
desc.magnetic_fields.field_line_integrate
- 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