eelbrain.plot.TopomapBins

class eelbrain.plot.TopomapBins(y, xax=None, ds=None, sub=None, bin_length=0.05, tstart=None, tstop=None, vmax=None, vmin=None, cmap=None, contours=None, proj='default', res=None, interpolation=None, clip='even', clip_distance=0.05, head_radius=None, head_pos=0, im_interpolation=None, sensors='.', sensorlabels=None, mark=None, mcolor=None, msize=20, marker='o', axtitle=True, **kwargs)

Topomaps in time-bins

Parameters
  • y (Union[NDVar, str, Sequence[Union[NDVar, str]]]) – Data to plot.

  • xax (Union[Factor, Interaction, NestedEffect, str, None]) – Create a separate plot for each cell in this model.

  • ds (Optional[Dataset]) – If a Dataset is provided, data can be specified as strings.

  • sub (Union[Var, ndarray, str, None]) – Specify a subset of the data.

  • bin_length (float) – Length ofthe time bins for topo-plots.

  • tstart (Optional[float]) – Beginning of the first time bin (default is the beginning of y).

  • tstop (Optional[float]) – End of the last time bin (default is the end of y).

  • vmax (Optional[float]) – Upper limits for the colormap (default is determined from data).

  • vmin (Optional[float]) – Lower limit for the colormap (default -vmax).

  • cmap (Optional[Any]) – Colormap (default depends on the data).

  • contours (Union[int, Sequence, Dict, None]) – Contours to draw on topomaps. Can be an int (number of contours, including vmin/vmax), a sequence (values at which to draw contours), or a **kwargs dict (must contain at least the “levels” key). Default is no contours.

  • proj (str) – The sensor projection to use for topomaps.

  • res (Optional[int]) – Resolution of the topomaps (width = height = res).

  • interpolation (Optional[Literal[None, ‘nearest’, ‘linear’, ‘spline’]]) – Method for interpolating topo-map between sensors (default is based on mne-python).

  • clip (bool | 'even' | 'circle') – Outline for clipping topomaps: ‘even’ to clip at a constant distance (default), ‘circle’ to clip using a circle.

  • clip_distance (float) – How far from sensor locations to clip (1 is the axes height/width).

  • head_radius (Union[float, Tuple[float, float], None]) – Radius of the head outline drawn over sensors (on sensor plots with normalized positions, 0.45 is the outline of the topomap); 0 to plot no outline; tuple for separate (right, anterior) radius. The default is determined automatically.

  • head_pos (Union[float, Sequence[float]]) – Head outline position along the anterior axis (0 is the center, 0.5 is the top end of the plot).

  • im_interpolation (Optional[str]) – Topomap image interpolation (see Matplotlib’s imshow()). Matplotlib 1.5.3’s SVG output can’t handle uneven aspect with interpolation='none', use interpolation='nearest' instead.

  • sensors (Union[str, MarkerStyle]) – How to mark sensor locations in the topomap (empty string '' to omit marks).

  • sensorlabels (Optional[Literal[‘’, ‘none’, ‘index’, ‘name’, ‘fullname’]]) – Show sensor labels. For ‘name’, any prefix common to all names is removed; with ‘fullname’, the full name is shown.

  • mark (Sensor index) – Sensors which to mark.

  • mcolor (Union[Any, Sequence[Any], None]) – Color for marked sensors (see matplotlib.pyplot.scatter()).

  • msize (Union[float, Sequence[float]]) – Size of the markers (see matplotlib.pyplot.scatter()).

  • marker (Union[str, MarkerStyle]) – Marker shape (see matplotlib.pyplot.scatter()).

  • axtitle (Union[bool, Sequence[str]]) – Title for the individual axes. The default is the time bin center.

  • ... – Also accepts General layout parameters.

Notes

Keys:
  • t: open a Topomap plot for the map under the mouse pointer.

  • T: open a larger Topomap plot with visible sensor names for the map under the mouse pointer.

Methods

add_contour(level[, color, meas])

Add a contour line

add_hline(y[, axes])

Draw a horizontal line on one or more axes

add_hspan(bottom, top[, axes])

Draw a horizontal bar on one or more axes

add_vline(x[, axes])

Draw a vertical line on one or more axes

add_vspan(xmin, xmax[, axes])

Draw a vertical bar on one or more axes

close()

Close the figure.

draw()

(Re-)draw the figure (after making manual changes).

draw_crosshairs([enable])

Draw crosshairs under the cursor

draw_outline([color])

Draw the outline of the figure

get_vlim([meas])

Retrieve colormap value limits as (vmin, vmax) tuple

image([name, format, close])

Create FMTXT Image from the figure

mark_sensors(sensors[, axis])

Mark given sensors on the plots

plot_colorbar([label, label_position, ...])

Plot a colorbar corresponding to the displayed data

save(*args, **kwargs)

Short-cut for Matplotlib's savefig()

separate_labels([pad])

Move overlapping labels apart along the x axis

set_cmap(cmap[, meas])

Change the colormap in the array plots

set_label_color([color])

set_label_text([text])

Add/remove sensor labels

set_name(name)

Set the figure window title

set_vlim([v, vmax, meas])

Change the colormap limits

set_xlabel(label[, ax])

Set the label for the x-axis

set_xtick_rotation(rotation)

Rotate every x-axis tick-label by an angle (counterclockwise, in degrees)

set_ylabel(label[, ax])

Set the label for the y-axis