plotERPs(erps,
data=None,
ax=None,
pre=0.2,
post=None,
pre_onset=None,
xlabel='time (s)',
ylabel='$\mu V$',
ylim=None,
ymult=1.0,
legend=None,
xlformat='%4g',
ylformat='%4g',
loffset=10,
alinewidth=2,
**kwargs)
| source code
|
Plot multiple ERPs on a new figure.
:Parameters:
erps : list of tuples
List of definitions of ERPs. Each tuple should consist of
(label, color, onsets) or a dictionary which defines,
label, color, onsets, data. Data provided in dictionary overrides
'common' data provided in the next argument ``data``
data
Data for ERPs to be derived from 1D (samples)
ax
Where to draw (e.g. subplot instance). If None, new figure is
created
pre : float
Duration (seconds) to be plotted prior to onset
pre_onset : float or None
If data is already in epochs (2D) then pre_onset provides information
on how many seconds pre-stimulus were used to generate them. If None,
then pre_onset = pre
post : float or None
Duration (seconds) to be plotted after the onset. If any data is
provided with onsets, it can't be None. If None -- plots all time
points after onsets
ymult : float
Multiplier for the values. E.g. if negative-up ERP plot is needed:
provide ymult=-1.0
xlformat : basestring
Format of the x ticks
ylformat : basestring
Format of the y ticks
legend : basestring or None
If not None, legend will be plotted with position argument
provided in this argument
loffset : int
Offset in voxels for axes and tick labels. Different
matplotlib frontends might have different opinions, thus
offset value might need to be tuned specifically per frontend
alinewidth : int
Axis and ticks line width
**kwargs
Additional arguments provided to plotERP()
:Examples:
kwargs = {'SR' : eeg.SR, 'pre_mean' : 0.2}
fig = plotERPs((('60db', 'b', eeg.erp_onsets['60db']),
('80db', 'r', eeg.erp_onsets['80db'])),
data[:, eeg.sensor_mapping['Cz']],
ax=fig.add_subplot(1,1,1,frame_on=False), pre=0.2,
post=0.6, **kwargs)
or
fig = plotERPs((('60db', 'b', eeg.erp_onsets['60db']),
{'color': 'r',
'onsets': eeg.erp_onsets['80db'],
'data' : data[:, eeg.sensor_mapping['Cz']]}
),
data[:, eeg.sensor_mapping['Cz']],
ax=fig.add_subplot(1,1,1,frame_on=False), pre=0.2,
post=0.6, **kwargs)
:Returns: current fig handler
|