visbrain.objects.GridSignalsObj

class visbrain.objects.GridSignalsObj(name, data, axis=-1, plt_as='grid', n_signals=10, lw=2.0, color='white', title=None, title_size=10, title_bold=True, title_visible=True, decimate='auto', transform=None, parent=None, verbose=None)[source][source]

Take a VisPy visual and turn it into a compatible Visbrain object.

Parameters:
namestring

The name of the GridSignals object.

dataarray_like

The data to plot. The following types are supported :

  • NumPy array : a 1D, 2D or 3D array

  • mne.io.Raw

  • mne.io.RawArray

  • mne.Epochs

axisint | -1

Location of the time axis.

plt_as{‘grid’, ‘row’, ‘col’}

Plotting type. By default data is presented as a grid. Use :

  • ‘grid’ : plot data as a grid of signals.

  • ‘row’ : plot data as a single row. Only horizontal camera movements are permitted

  • ‘col’ : plot data as a single column. Only vertical camera movements are permitted

n_signalsint | 10

Number of signals to display if plt_as is row or col.

lwfloat | 2.

Line width.

colorstring, list, tuple | ‘white’

Line color.

titlelist | None

List of strings describing the title of each element. The length of this list depends on the shape of the provided data.

  • 1d = (n_times,) : len(title) = 1

  • 2d = (n_rows, n_times) : len(title) = n_rows

  • 3d = (n_rows, n_cols, n_times) : len(title) = n_rows * n_cols

If an MNE-Python object is passed, titles are automatically inferred.

title_sizefloat | 10.

Size of the title text.

title_boldbool | True

Specify if titles should be bold or not.

title_visiblebool | True

Specify if titles should be displayed.

decimatestring, bool, int | ‘auto’

Depending on your system, plotting a too large number of signals can possibly fail. To fix this issue, there’s a limited number of points of (20 million) and if your data exceeds this number of points, data is decimated along the time axis. Use :

  • ‘auto’ : automatically find the most appropriate decimation factor

  • int : use a specific decimation ratio (e.g 2, 3 etc)

  • False : if you don’t want to decimate

transformVisPy.visuals.transforms | None

VisPy transformation to set to the parent node.

parentVisPy.parent | None

Hypnogram object parent.

verbosestring

Verbosity level.

Methods

__init__(name, data[, axis, plt_as, ...])

Init.

animate([step, interval, iterations])

Animate the object.

copy()

Get a copy of the object.

describe_tree()

Tree description.

preview([bgcolor, axis, xyz, show, obj, ...])

Previsualize the result.

record_animation(name[, n_pic, bgcolor])

Record an animated object and save as a *.gif file.

render()

Render the canvas.

screenshot(saveas[, print_size, dpi, unit, ...])

Take a screeshot of the scene.

set_shortcuts_to_canvas(canvas)

Set shortcuts to a VisbrainCanvas.

to_dict()

Return a dictionary of all colorbar args.

to_kwargs([addisminmax])

Return a dictionary for input arguments.

update()

Fonction to run when an update is needed.

update_from_dict(kwargs)

Update attributes from a dictionary.

Examples using visbrain.objects.GridSignalsObj

Grid of signals object (GridSignalsObj) : complete tutorial

Grid of signals object (GridSignalsObj) : complete tutorial