nenupy.io.tf_utils.plot_spectrum

nenupy.io.tf_utils.plot_spectrum(frequency, data, fig=None, ax=None, figsize=(10, 5), dpi=200, xlabel=None, ylabel=None, title=None, norm='linear', vmin=None, vmax=None)[source]

Plot a spectrum. This function uses plot() in the background.

Parameters:
  • frequency (Quantity) – One-dimensional frequency array, if ylabel is None, the unit is automatically used to describe the axis.

  • data (ndarray) – One-dimensional array, shaped like (time,).

  • fig (Figure, optional) – Matplotlib figure if already existing, by default None

  • ax (Axes, optional) – Matplotlib ax if already existing, by default None

  • figsize (Tuple[int, int], optional) – Size of the figure in inches, by default (10, 5)

  • dpi (int, optional) – Dots per inch (best quality is around 300), by default 200

  • xlabel (str, optional) – Label of the x-axis (time), by default None (i.e., generic label)

  • ylabel (str, optional) – Label of the y-axis (time), by default None (i.e., generic label)

  • title (str, optional) – Title of the graph, by default None (i.e., empty)

  • norm (str, optional) – Normalization of the colorbar (‘linear’ or ‘log’), by default “linear”

  • vmin (float, optional) – Minimal data value to plot, by default None

  • vmax (float, optional) – Maximal data value to plot, by default None

Returns:

The figure and ax objects

Return type:

Tuple[Figure, Axes]

Raises:

ValueError – Raised if norm does not match supported value.