class visbrain.gui.Signal(data, axis=-1, time=None, sf=1.0, enable_grid=True, form='line', color='black', line_lw=1.0, line_smooth=False, marker_symbol='disc', marker_size=10.0, hist_nbins=10, tf_norm=0, tf_baseline=None, tf_interp='gaussian', tf_cmap='viridis', tf_av_window=None, tf_av_overlap=0.0, tf_clim=None, psd_nperseg=256, psd_noverlap=128, display_grid=True, display_signal=True, annotations=None, annot_txtsz=18.0, annot_marksz=16.0, annot_color='#2ecc71', grid_lw=1.0, grid_smooth=False, grid_titles=None, grid_font_size=10.0, grid_color='black', grid_shape=None, grid_titles_color='black', verbose=None, **kwargs)[source][source]

Signal inspection module (data mining).

The Signal module can be used to relatively large datasets of time-series. Two layout are provided :

  • Grid layout : visualize all of the signals into a grid.

  • Signal layout : visualize only one signal.


Array of data of shape (N,),

axisint | -1

Specify where is located the time axis in data. By default, the last axis is considered as the time axis (-1).

timearray_like | None

Time vector to use. If None, the time vector is inferred using the axis input.

sffloat | 1.

Sampling frequency.

enable_gridbool | True

Enable or disable the grid. If False, the grid is not computed and not accessible from the GUI. The grid requires more memory RAM. It could be turn to False for very large datasets.

form{‘line’, ‘marker’, ‘histogram’, ‘tf’, ‘psd’, ‘butterfly’}

Plotting type.

colorarray_like/string/tuple | ‘black’

Color of the plot.

line_lwfloat | 1.

Line width (form in [‘line’, ‘psd’, ‘butterfly’]).

line_smoothbool | False

Specify if grid lines have to be smoothed. might be unstable on some platform.

marker_symbolstring | ‘o’

Marker symbol.

marker_sizefloat | 10.

Marker size.

hist_nbinsint | 10

Number of bins for the histogram.

tf_normint | 0

Time-frequency normalization. If tf_baseline is not defined, the mean and deviation are deduced using the entire trial. Use :

  • 0 : No normalization

  • 1 : Subtract the mean

  • 2 : Divide by the mean

  • 3 : Subtract then divide by the mean

  • 4 : Z-score

tf_baselinetuple | None

Baseline to used for the normalization. Must be a tuple of two integers (starting, ending) time index.

tf_interpstring | ‘gaussian’

Time-frequency interpolation method.

tf_cmapstring | ‘viridis’

Time-frequency colormap.

tf_av_windowint | None

Length of the window to apply a time averaging.

tf_av_overlapfloat | 0.

Overlap between successive time window. Default 0. means no overlap.

tf_climtuple | None

Colorbar limits to use for the tim-frequency map.

psd_npersegint | 256

Length of each segment (scipy.signal.welch).

psd_noverlapint | 128

Number of points to overlap between segments (scipy.signal.welch).

parentVisPy.parent | None

Parent of the mesh.

titlestring | None

Title of the axis (signal layout).

xlabelstring | None

Label for the x-axis (signal layout).

ylabelstring | None

Label for the y-axis (signal layout).

title_font_sizefloat | 15.

Size of the title (signal layout).

axis_font_sizefloat | 12.

Size of x and y labels (signal layout).

axis_colorarray_like/string/tuple | ‘black’

Label, title, axis and border color (signal layout).

tick_font_sizefloat | 8.

Size of ticks for the x and y-axis (signal layout).

grid_lwfloat | 1.

Grid line width.

grid_titleslist | None

Titles do add to each plot in the grid. Sould be a list of length (n_rows * n_cols).

grid_font_sizefloat | 10.

Font size of grid titles.

grid_colorstring | ‘random’

Grid plot color. Use ‘random’ to have one random color per plot or use a string (e.g. ‘gray’) for a uniform color.

grid_titles_colorarray_like/string/tuple | ‘black’

Grid titles color.

bgcolorarray_like/tuple/string | ‘black’

Background color.

display_gridbool | True

Display the grid layout.

display_signalbool | True

Display the signal layout.

annotationsstr | None

Path to an annotation file.

smooth_linesbool | True

Specify if grid lines have to be smoothed. might be unstable on some platform.

screenshot(self, filename='screenshot.png', canvas='signal', autocrop=False, region=None, print_size=None, unit='centimeter', dpi=300.0, factor=1.0, bgcolor=None, transparent=False)[source][source]

Take a screenshot of the scene.

filenamestring | ‘screenshot.png’

Name and path of the screenshot file.

canvas{‘signal’, ‘grid’}

Canvas to capture.

autocropbool | False

Auto-cropping argument to remove useless space.

regiontuple/list | None

The region to export (x_start, y_start, width, height).

print_sizetuple | None

The desired print size. This argument should be used in association with the dpi and unit inputs. print_size describe should be a tuple of two floats describing (width, height) of the exported image for a specific dpi level. The final image might not have the exact desired size but will try instead to find a compromize regarding to the proportion of width/height of the original image.

unit{‘centimeter’, ‘millimeter’, ‘pixel’, ‘inch’}

Unit of the printed size.

dpifloat | 300.

Dots per inch for printing the image.

factorfloat | None

If you don’t want to use the print_size input, factor simply multiply the resolution of your screen.

bgcolorarray_like/string | None

Background color of the canvas.

transparentbool | False

Use transparent background.

set_signal_form(self, form='line')[source][source]

Set plotting method.

form{‘line’, ‘marker’, ‘histogram’, ‘tf’, ‘psd’, ‘butterfly’}

Plotting form.

set_signal_index(self, index)[source][source]

Set the index of the signal.

set_xlim(self, xstart, xend)[source][source]

Fix limits of the x-axis.


Starting point of the x-axis.


Ending point of the x-axis

set_ylim(self, ystart, yend)[source][source]

Fix limits of the y-axis.


Starting point of the y-axis.


Ending point of the y-axis


Display the graphical user interface.

update_cameras(self, g_rect=None, s_rect=None, update='both')[source][source]

Update cameras.