nifty7.plot module

class Plot[source]

Bases: object

add(f, **kwargs)[source]

Add a figure to the current list of plots.

Notes

After doing one or more calls add(), one needs to call output() to show or save the plot.

Parameters
  • f (Field or list of Field) – If f is a single Field, it must be defined on a single RGSpace, PowerSpace, HPSpace, GLSpace. If it is a list, all list members must be Fields defined over the same one-dimensional RGSpace or PowerSpace.

  • Parameters (Optional) –

  • -------------------

  • title (string) – Title of the plot.

  • xlabel (string) – Label for the x axis.

  • ylabel (string) – Label for the y axis.

  • [xyz]min (float) – Limits for the values to plot.

  • [xyz]max (float) – Limits for the values to plot.

  • cmap (string) – Color map to use for the plot (if it is a 2D plot).

  • linewidth (float or list of floats) – Line width.

  • label (string of list of strings) – Annotation string.

  • alpha (float or list of floats) – Transparency value.

  • freq_space_idx (int) – for multi-frequency plotting: index of frequency space in domain

output(**kwargs)[source]

Plot the accumulated list of figures.

Parameters
  • title (string) – Title of the full plot.

  • nx (int) – Number of subplots to use in x- and y-direction. Default: square root of the numer of plots, rounded up.

  • ny (int) – Number of subplots to use in x- and y-direction. Default: square root of the numer of plots, rounded up.

  • xsize (float) – Dimensions of the full plot in inches. Default: 6.

  • ysize (float) – Dimensions of the full plot in inches. Default: 6.

  • name (string) – If left empty, the plot will be shown on the screen, otherwise it will be written to a file with the given name. Supported extensions: .png and .pdf. Default: None.

  • block (bool) – Override the blocking behavior of the non-interactive plotting mode. The plot will not be closed in this case but is left open!