Skip to content

← visualization package

TimeSeriesDiff

Show the difference between two time series.

This can be used to analyze, for instance, the effect of artifact removal on the data. Scaling is based on the last provided stream that is displayed, therefore for before/after processing comparisons, it is recommended to use data1 for the least processed version, and so forth. This node displays missing channels and missing time windows as gaps in the plot. Version 0.9.0

Ports/Properties

data1

First time series.

verbose name
Data1
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
IN

data2

Second time series.

verbose name
Data2
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
IN

data3

Third time series (optional).

verbose name
Data3
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
IN

stream

Name of stream to display. The first stream whose name starts with this string is displayed.

verbose name
Stream To Display
default value
None
port type
StringPort
value type
str (can be None)

stream_name

verbose name
Stream Name
default value
None
port type
AliasPort
value type
str (can be None)

scale

Data scale. Increasing this value will magnify the plot curves correspondingly. A scale of 1 will scale the data such that the next channel is at 1 std. dev. of the previous channel.

verbose name
Data Scaling
default value
0.2
port type
FloatPort
value type
float (can be None)

title

Title of the plot. This is the title of the plot window. Placeholders like $(streamname1) or $(sourceid1) can be used here.

verbose name
Title Of Plot Window
default value
Time series diff
port type
StringPort
value type
str (can be None)

line_colors

Color of the graph curves. See background_color for the color format.

verbose name
Line Colors
default value
['tab:orange', 'tab:blue', 'tab:red']
port type
ListPort
value type
list (can be None)

line_opacities

Set the opacity (alpha) values (0-1) for each of the graph curves in order of the data inputs. Higher values are more opaque (less transparent).

verbose name
Line Opacities
default value
[1.0, 1.0]
port type
ListPort
value type
list (can be None)

marker_color

Color of vertical lines for marker events. Either a string or a dictionary that represents a mapping from event type to color (the special key '*' stands for all other markers).

verbose name
Marker Color
default value
#000000
port type
Port
value type
object (can be None)

decoration_color

Color of the axis decorations.

verbose name
Decoration Color
default value
#000000
port type
StringPort
value type
str (can be None)

figure_background_color

Background color for figure window (outside plot axes). This can be given in hexadecimal (web) notation (#RRGGBB). For instance 00 is zero, 7F is half brightness, and FF is full brightness, so #FF00FF yields a color that is a mix of bright red and blue, i.e., bright purple). Alternatively, named matplotlib colors can be used, such as red or blue.

verbose name
Figure Background Color
default value
white
port type
StringPort
value type
str (can be None)

plot_background_color

Background color for inside plot (within x/y axes). This can be hexadecimal (web) notation (#RRGGBB) or CSS named colors ('white'). For instance 00 is zero, 7F is half brightness, and FF is full brightness, so #FF00FF yields a color that is a mix of bright red and blue, i.e., bright purple).

verbose name
Plot Background Color
default value
white
port type
StringPort
value type
str (can be None)

background_color

This parameter is being deprecated in favor of the combination of "figure_background_color" and "plot_background_color" to separate the colors outside the plot and within the plot (x/y axes), respectively.

verbose name
Background Color
default value
None
port type
AliasPort
value type
str (can be None)

line_width

Line width for plotting.

verbose name
Line Width
default value
0.75
port type
FloatPort
value type
float (can be None)

zeromean

Display data with mean corrected to zero. This makes sure that each channel is centered for better viewing. If this is disabled, your data may be outside the window, especially if you have not performed high-pass filtering on your signal. Enabling this may make the curves appear to shift up or down if their mean is not already zero.

verbose name
Center (Zero-Mean) Data
default value
True
port type
BoolPort
value type
bool (can be None)

autoscale

Automatically scale channels to a standard scale. This makes sure that channels are rescaled such that they fit comfortably in the drawing area. All channels are rescaled by the same scale factor. Enabling this may make the curves appear to change scale suddenly, especially when large artifacts come into view or go out of view.

verbose name
Autoscale Data
default value
True
port type
BoolPort
value type
bool (can be None)

show_markers

"Whether to show event markers. If 'none', no markers are shown. If 'last', only the last marker stream is shown. If 'all', all marker streams are shown.

verbose name
Show Markers
default value
first
port type
EnumPort
value type
str (can be None)

antialiased

Draw graphics antialiased. If enabled, the lines will appear less pixelated or 'jaggy', however, this can slow down plotting.

verbose name
Draw Antialiased Lines
default value
True
port type
BoolPort
value type
bool (can be None)

simplification

Simplify graphics finer than this threshold. Increasing this can be used to speed up drawing for many channels and time points.

verbose name
Simplification Threshold
default value
0.5
port type
FloatPort
value type
float (can be None)

max_gap_len

Maximum gap length in seconds. Samples that are separated by a gap larger than this will have no connecting line drawn between them.

verbose name
Max Gap Len
default value
0.1
port type
FloatPort
value type
float (can be None)

correct_filter_lag

Correct for filter lag. If enabled, the data is shifted by the filter lag recorded in the respective stream to allow for perfect super-position of data from different processing chains.

verbose name
Correct Filter Lag
default value
True
port type
BoolPort
value type
bool (can be None)

t0_is_zero

Count time from zero. If set to False, the time starts at whatever is the first time stamp in the data.

verbose name
T0 Is Zero
default value
True
port type
BoolPort
value type
bool (can be None)

data_margins

Margins around the data area. The first value is the horizontal margin (left and right), in seconds. The second value is the vertical margin (top and bottom), in units of channels, i.e., a value of 3 will leave a gap 3 channels worth above and below the data.

verbose name
Data Margins
default value
[20, 3]
port type
ListPort
value type
list (can be None)

xtick_interval

Interval of timestamps (in seconds) to display.

verbose name
Xtick Interval
default value
1.0
port type
FloatPort
value type
float (can be None)

window_dims

Initial position of the window on the monitor. If this is set to empty, then no window will be shown (e.g., if you only export to a file). This is given in pixels, and is formatted as [x, y, width, eight]. If x, y are set to 0 each, then the window will appear in the top left corner of the screen.

verbose name
Initial Window Position
default value
[20, 20, 1200, 700]
port type
ListPort
value type
list (can be None)

export_dims

Dimensions of the exported figure. This is given in pixels, and is formatted as [width, height]. Only used when save_to_file is set.

verbose name
Export Dims
default value
[32000, 3200]
port type
ListPort
value type
list (can be None)

save_to_file

If set, the plot will be saved to the specified file. The file format is determined by the file extension.

verbose name
Save To File
default value
port type
StringPort
value type
str (can be None)

export_only

If set to True, only export and save the specified file (no interactive plot).

verbose name
Export Only
default value
False
port type
BoolPort
value type
bool (can be None)

dpi

DPI (dots per inch) for plotting. Note this value can significantly affect the size of the output file (if saving to disk).

verbose name
Dpi
default value
100
port type
IntPort
value type
int (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)