[Eeglablist] unable to plot several datasets on the same set of axes

Maria Kharitonova Maria.Kharitonova at Colorado.EDU
Tue Feb 5 11:39:24 PST 2008


Hello,

I'm a very novice EEGLAB user, so I apologize in advance for a potentially silly question. 

I have been unsuccessfully trying to plot several datasets (each corresponding to a different condition from the same experiment) on 1 
set of axes (to enable visual comparisons between waveforms for different conditions). Below is the code I've been using.

For my experiment, I need to calculate difference waveforms for contralateral and ipsilateral stimulus presentation. I have a function 
left_minus_right() that does this transformation. 

I do this transformation for each of my 3 conditions/datasets (EEG_12, EEG_34, and EEG_56)

EEG_diff_12 = left_minus_right(EEG_12);
EEG_diff_34 = left_minus_right(EEG_34);
EEG_diff_56 = left_minus_right(EEG_56);

I then save each one as a separate dataset.

pop_saveset(EEG_diff_12,'FEWM2 1to41_keptonly.ref_remapped_12.set', './');           
pop_saveset(EEG_diff_34,'FEWM2 1to41_keptonly.ref_remapped_34.set', './');           
pop_saveset(EEG_diff_56,'FEWM2 1to41_keptonly.ref_remapped_56.set', './');           

Then I try to plot these 3 conditions on 1 set of axes using this code:

figure; 
pop_plottopo(EEG_diff_12, [1:127] , 'EEG_diff_12', 0,  'limits',[-200 1200 -5 5], 'colors', {'r'} );

figure; 
pop_plottopo(EEG_diff_34, [1:127] , 'EEG_diff_34', 0,  'limits',[-200 1200 -5 5], 'colors', {'k'} );

figure; 
pop_plottopo(EEG_diff_56, [1:127] , 'EEG_diff_56', 0,  'limits',[-200 1200 -5 5], 'colors', {'b'} );


If I don't use "figure" before each pop_plottopo call, I get the 2nd plot to be superimposed on the lower-right-hand corner of the 1st 
plat (i.e. where the scale usually sits) - very strange. I have also tried using "hold" and "hold on" commands without any success.

The only way I've gotten it to work is through the GUI. I load each dataset separately. Then I go to Plot -> Sum/Compare ERPs -> I 
enter 1 2 3 in the "Datasets to Average" field, I check the box for "All ERPs" and uncheck all the other boxes. I hit OK.

this produces a plot that I want - all 3 datasets on the same set of axes. However, it takes a very long time to do this through gui and I 
don't know how to specify the colors of the line and the sizes of the axes (e.g. only from -2 to 2 mV on the y-axis) without going to 
the Plot Editor, which takes a long time. 

I'm looking at individual subjects, so I would much prefer to use an inline script to automate this process, so if you have any 
suggestions for plotting 3 different datasets onto a single set of axes, that would be extremely helpful.

Thanks very much in advance!
Maria


*************************************
Maria Kharitonova, M.A.
Department of Psychology
University of Colorado, Boulder




More information about the eeglablist mailing list