desc.plotting.plot_surfaces

desc.plotting.plot_surfaces(eq, rho=8, theta=8, zeta=None, ax=None, return_data=False, **kwargs)[source]

Plot flux surfaces.

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

  • rho (int or array-like) – Values of rho to plot contours of. If an integer, plot that many contours linearly spaced in (0,1).

  • theta (int or array-like) – Values of theta to plot contours of. If an integer, plot that many contours linearly spaced in (0,2pi).

  • zeta (int or array-like or None) – Values of zeta to plot contours at. If an integer, plot that many contours linearly spaced in (0,2pi). Default is 1 contour for axisymmetric equilibria or 6 for non-axisymmetry.

  • 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) label: str, label of the plotted line (e.g. to be shown with ax.legend()) NR: int, number of equispaced rho point to use in plotting the vartheta contours NT: int, number of equispaced theta points to use in plotting the rho contours theta_color: str or tuple, color to use for constant vartheta contours theta_ls: str, linestyle to use for constant vartheta contours theta_lw: float, linewidth to use for constant vartheta contours rho_color: str or tuple, color to use for constant rho contours rho_ls: str, linestyle to use for constant rho contours rho_lw: float, linewidth to use for constant rho contours lcfs_color: str or tuple, color to use for the LCFS constant rho contour lcfs_ls: str, linestyle to use for the LCFS constant rho contour lcfs_lw: float, linewidth to use for the LCFS constant rho contour axis_color: str or tuple, color to use for the axis plotted point axis_alpha: float, transparency of the axis plotted point axis_marker: str, markerstyle to use for the axis plotted point axis_size: float, markersize to use for the axis plotted point title_font_size: integer, font size of the title xlabel_fontsize: float, fontsize of the xlabel ylabel_fontsize: float, fontsize of the ylabel

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_R_coords”,”rho_Z_coords”, Cylindrical R,Z coordinates of rho contours “vartheta_R_coords”, “vartheta_Z_coords”,

    Cylindrical R,Z coordinates of vartheta contours

Examples

../../_images/plot_surfaces.png
from desc.plotting import plot_surfaces
fig, ax = plot_surfaces(eq)