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, ifylabelisNone, theunitis automatically used to describe the axis.data (
ndarray) – One-dimensional array, shaped like (time,).fig (
Figure, optional) – Matplotlib figure if already existing, by defaultNoneax (
Axes, optional) – Matplotlib ax if already existing, by defaultNonefigsize (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 200xlabel (
str, optional) – Label of the x-axis (time), by defaultNone(i.e., generic label)ylabel (
str, optional) – Label of the y-axis (time), by defaultNone(i.e., generic label)title (
str, optional) – Title of the graph, by defaultNone(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 defaultNonevmax (
float, optional) – Maximal data value to plot, by defaultNone
- Returns:
The figure and ax objects
- Return type:
- Raises:
ValueError – Raised if
normdoes not match supported value.