SpectrumPlot¶
Plot a multi-channel spectrum in real time.
This node assumes that spectrum has already been estimated using one of the spectral estimation nodes (i.e., Spectrogram). The node requires that the data has a frequency axis, and either a space (channels) or a feature axis. Any additional axes are folded into a flat space axis. This node is designed for continuous data (either streaming or offline), rather than segmented data. (If segmented, it always plots the most recent segment.) The node can either plot the spectra for all channels superimposed, or it can stack the channels on top of each other ("stacked mode"). Stacked mode is only available for streaming data. In stacked mode, the node automatically scales the data using a relative unit (std.dev). If not in stacked mode, you can choose whether to show the spectrum in absolute units (PSD or dB) or in relative units (std.dev). If in absolute units, the unit values are displayed along the Y axis, and the range can be set with the y_range property (which subsequently changes the scale). This node also supports correction for the 1/f falloff curve observed in natural spectra. This node provides keyboard shortcuts for toggling the stacking (s), and 1/f correction (1) options. This plotter can be used for "offline" (non-streaming) data, in which case the frequency plot is generated for the entire session or selected time segment. When plotting offline data, the Y axis can be either in absolute units (PSD or dB) or in relative units (std.dev). Stacked mode does not apply in offline mode. Version 2.1.0
Ports/Properties¶
stream¶
Name of stream to plot. Wildcards are supported, i.e. mystream* will plot the first stream whose name starts with mystream.
stream_name¶
max_channels¶
Max number of channels to display at once. Note that a large number of channels can slow the plot down considerably, and is not recommended. Alternatively, instead of increasing this, use the PgUp/PgDn (or u/d) keys in the plot window to show the prev/next set of n channels (where n is this number).
auto_line_colors¶
Automatically assign a different color to each line or bar. Takes precedence if selected. See colormap property to determine the color selection.
colormap¶
Colormap to use for auto assign colors. (See matplotlib online documentation for colormap examples.)
background_color¶
Background color. This can be hexadecimal (hex) notation (#RRGGBB) or CSS named colors ('white'). One resource (among many) that provides a list of both hex and CSS named colors is https://www.w3.org/wiki/CSS/Properties/color/keywords.
decoration_color¶
Color of the axis labels and ticks. (See background_color description for details.).
plot_minmax¶
Display min and max values of original data irrespective of scaling.
title¶
Title of the plot window. The placeholders $(streamname), $(sourceid), and $(sourceurl) can be used here.
initial_dims¶
Initial position of the window on the monitor. This is given in pixels, and is formatted as [x, y, width, height]. If x, y are set to 0 each, then the window will appear in the top left corner of the current screen.
left_offset¶
Left offset of the window on the monitor. The x value in the initial window position property will be increased by this amount. Use this to shift all plots to a second monitor, for example. May be a negative number (i.e., to move plots to a window to the left).
show_toolbar¶
Show the window toolbar (which provides some additional functions).
always_on_top¶
Window should be always on top. If this is enabled, then the window will not be occluded by other windows.
tight_layout¶
Reduce the amount of white space around the plot within the window.
font_size¶
Font size (in points) of text plotted outside the plot axes, such as axis labels, legend, etc.
annotation_font_size¶
Font size (in points) for text which appear inside the plot axes, such as markers, scale, etc.
antialiased¶
Draw graphics antialiased. If set to False, lines will appear more pixelated or 'jaggy', but plotting should render faster.
max_redraw_hz¶
Maximum redraw rate of this plot in Hz. Limits how often the matplotlib canvas is repainted (and, when the plot feeds a Plot Dashboard, how often the dashboard re-renders the corresponding panel). None means use the Plot Dashboard's default for downstream panels and no throttle for this node's own window. 0 means no throttle (legacy behavior, draw on every tick). A positive value is the upper bound on the redraw rate. Reducing this is particularly useful for nodes whose draw is expensive (e.g. matplotlib tables, which are heavy on macOS due to CoreText).
line_color¶
Color of the lines. (See background_color description for details.)
zero_color¶
Color of the grid lines. (See background color description for details.)
line_width¶
Width of the lines (or bars).
label_rotation¶
Orientation of plot Y axis tick labels.
x_label¶
Label for the X axis. Leave empty to automatically use a suitable default.
y_label¶
Label for the Y axis. Leave empty to automatically use a suitable default.
verbose¶
Print additional information such as if the incoming packet has no data to plot, etc.
track_window_position¶
Track the window position and print the new position in the console. This is useful for setting the window position property.
suppress_window¶
Suppress the display window. When enabled, the node will not open a plot window; use this when feeding the figure output into a Plot Dashboard node.
figure_out¶
Plot data for PlotDashboard (PlotData).
data¶
Data to display.
stacked¶
Display spectra stacked on top of each other instead of superimposed. If this is enabled, the Y axis will show the channel names and the unit be SD regardless of the unit setting.
unit¶
The unit in which to display the data. By default, this node assumes the incoming data is PSD, and therefore selecting PSD does not further transform the data. Selecting dB will convert the data to dB before plotting, and selecting SD (Std Dev) will plot the standard deviation from the mean for each packet (if streaming data) or for the entire session (if offline data). Selecting data will plot the incoming data without any transformation, and use as the Y-axis label the Metadata.unit property of the chunk, if present.
one_over_f_correction¶
Correct for 1/f spectrum falloff. If enabled, the 1/f falloff curve frequently observed in natural signals will be compensated.
y_range¶
Range of values to use for scaling of the Y axis, in the incoming unit (PSD, dB, StdDev), as a two element list. This only applies if stacked mode is off. If an empty list or set to [0,0] the min and max values of the data is used as the range.
x_range¶
Range of frequencies to plot, in Hz, as a two element list. If an empty list or [0,0], the min / max frequencies of the incoming data will be used.
scale¶
Deprecated; data is always autoscaled in stacked mode, and otherwise, the y axis range property is used to determine the scale.
autoscale¶
Deprecated; data is automatically autoscaled in stacked mode, and otherwise, the y axis range property is used to determine the scale.]
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.