[Eeglablist] Plotting standard error shades on ERP

Beach, Paul paul.anthony.beach at emory.edu
Tue Jul 20 09:31:17 PDT 2021


Thank you, Arnaud and Cedric for your replies.

Arnaud - I was able to get it to work using the command line text found in the link you forwarded. I’m wondering, though, how I can modify things to directly test different conditions.

[STUDY erpdata erptimes] = std_erpplot(STUDY, ALLEEG, 'channels', {'Fp1'}, 'timerange', [-200 800]);
std_plotcurve(erptimes, erpdata, 'plotconditions', 'together', 'plotstderr', 'on', 'figure', 'on', 'filter', 10);

Right now the above command plots things based on the last design selection I made using the STUDY GUI. Unfortunately making changes in the GUI are not reflected in eegh, so I can’t use that to figure out things myself. Is there a way around this, so I can further learn how to make modifications independent of the GUI?

Thanks!
--
Paul Beach DO, PhD
PGY6, Movement Disorder Fellow
Department of Neurology
Emory University School of Medicine

On Jul 19, 2021, at 3:26 PM, Delorme, Arnaud via eeglablist <eeglablist at sccn.ucsd.edu<mailto:eeglablist at sccn.ucsd.edu>> wrote:

You can also do that at the study level

https://urldefense.proofpoint.com/v2/url?u=https-3A__nam11.safelinks.protection.outlook.com_-3Furl-3Dhttps-253A-252F-252Furldefense.proofpoint.com-252Fv2-252Furl-253Fu-253Dhttps-2D3A-5F-5Feeglab.org-5Ftutorials-5F11-2D5FScripting-5Fcommand-2D5Fline-2D5Fstudy-2D5Ffunctions.html-2D23plotting-2D2Dmeasures-2526d-253DDwIGaQ-2526c-253D-2D35OiAkTchMrZOngvJPOeA-2526r-253DkB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE-2526m-253DzCZzq-5FwBqEWelhXHg4ghBGQxhsI5nrsj21I5XvAbfEw-2526s-253DfHR7S-5FE50Bt-5F7j1SYgG-5FGXVumlWP0DBLPFCl5m8Na9I-2526e-253D-26amp-3Bdata-3D04-257C01-257Cpaul.anthony.beach-2540emory.edu-257C0b722fc7e739448d784408d94b91e9cc-257Ce004fb9cb0a4424fbcd0322606d5df38-257C0-257C0-257C637623912335463478-257CUnknown-257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0-253D-257C2000-26amp-3Bsdata-3Dcdzkv-252FWiHMqfciIFWdoBTkOj-252FTzBBy0cgvjCSMvKDIc-253D-26amp-3Breserved-3D0&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=kB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE&m=1Rg8_2SDlukIFHUjJ7xZiB7EOiebyxrCtb3eLXqt-zA&s=74qAVtRmh7EUscGmhzRzccOOec7tYvd9YU0XR-PmkYw&e= 

In scripts, the EEGLAB function “fillcurves" is also easy to use to create shaded areas.
See the function help message for more details.

figure; fillcurves(rand(1,100), rand(1,100)+1.5);

Arno

On Jul 18, 2021, at 11:51 PM, Cedric Cannard via eeglablist <eeglablist at sccn.ucsd.edu<mailto:eeglablist at sccn.ucsd.edu>> wrote:

Hi Paul,

Below is an example of one subject's epoched data. Define your channel_number of interest and for grand average. FOr you, the 3rd dimension is subjects instead of epochs.

data1 = squeeze(EEG.data(channel_number,:,:));
nEpochs = size(data1,2);
data1_mean = mean(data1,2)';
data1_se = std(data1 ./ sqrt(nEpochs),[],2)';
color1 = [0, 0.4470, 0.7410];
xAxis = 1:size(data1,1);        %ADJUST WITH YOUR LAGS

plot(xAxis, data1_mean,'LineWidth',2,'Color',color1); hold on
fillhandle = fill([xAxis fliplr(xAxis)], [data1_mean-data1_se fliplr(data1_mean+data1_se)], color1);
set(fillhandle,'EdgeColor', color1,'FaceAlpha',0.2,'EdgeAlpha',0.8);
set(gca,'FontSize',12,'layer','top');
grid on; axis tight; box on;
ylabel('ERP amplitude','FontSize',12);
xlabel('Time','FontSize',12);
hPlots = flip(findall(gcf,'Type','Line'));
legend(hPlots, 'data1Name (SE)');

And simply duplicate the lines containing data1 with data2 to superimpose another condition/group (i.e., data2).

Cedric


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Sunday, July 18th, 2021 at 4:25 AM, Beach, Paul via eeglablist <eeglablist at sccn.ucsd.edu<mailto:eeglablist at sccn.ucsd.edu>> wrote:

Hi EEGLAB’ers

I’ve seen this posted a few times. Seems like it’s relatively standard now to include standard error “shades” in publications these days of ERP data. I’d like to do this on my grand averaged STUDY data but am having a few hard time figuring out how to do so in EEGLAB. I sawCedric

had recommended a function he made using Matlab’s “fill” function, but seeing as this was seen in archived eeglablist data I cannot get the actual function.

Does anyone have tips/tricks for doing this in EEGLAB or other (preferably simple) methods?

Thanks!

Paul
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Paul Beach DO, PhD

PGY6, Movement Disorder Fellow

Department of Neurology

Emory University School of Medicine

This e-mail message (including any attachments) is for the sole use of

the intended recipient(s) and may contain confidential and privileged

information. If the reader of this message is not the intended

recipient, you are hereby notified that any dissemination, distribution

or copying of this message (including any attachments) is strictly

prohibited.

If you have received this message in error, please contact

the sender by reply e-mail message and destroy all copies of the

original message (including attachments).

Eeglablist page: https://urldefense.proofpoint.com/v2/url?u=https-3A__nam11.safelinks.protection.outlook.com_-3Furl-3Dhttp-253A-252F-252Fsccn.ucsd.edu-252Feeglab-252Feeglabmail.html-26amp-3Bdata-3D04-257C01-257Cpaul.anthony.beach-2540emory.edu-257C0b722fc7e739448d784408d94b91e9cc-257Ce004fb9cb0a4424fbcd0322606d5df38-257C0-257C0-257C637623912335463478-257CUnknown-257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0-253D-257C2000-26amp-3Bsdata-3DpmZ0tozY7AdYHFVIY8h7VE5-252F4HM-252BtO-252BdFqPraKefZE0-253D-26amp-3Breserved-3D0&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=kB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE&m=1Rg8_2SDlukIFHUjJ7xZiB7EOiebyxrCtb3eLXqt-zA&s=vBzHjj32wEkD6juvRFDVx-UWEKJMiJUpPk0pnOH7zNM&e= 

To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu<mailto:eeglablist-unsubscribe at sccn.ucsd.edu>

For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu<mailto:eeglablist-request at sccn.ucsd.edu>
_______________________________________________
Eeglablist page: https://urldefense.proofpoint.com/v2/url?u=https-3A__nam11.safelinks.protection.outlook.com_-3Furl-3Dhttp-253A-252F-252Fsccn.ucsd.edu-252Feeglab-252Feeglabmail.html-26amp-3Bdata-3D04-257C01-257Cpaul.anthony.beach-2540emory.edu-257C0b722fc7e739448d784408d94b91e9cc-257Ce004fb9cb0a4424fbcd0322606d5df38-257C0-257C0-257C637623912335463478-257CUnknown-257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0-253D-257C2000-26amp-3Bsdata-3DpmZ0tozY7AdYHFVIY8h7VE5-252F4HM-252BtO-252BdFqPraKefZE0-253D-26amp-3Breserved-3D0&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=kB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE&m=1Rg8_2SDlukIFHUjJ7xZiB7EOiebyxrCtb3eLXqt-zA&s=vBzHjj32wEkD6juvRFDVx-UWEKJMiJUpPk0pnOH7zNM&e= 
To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu<mailto:eeglablist-unsubscribe at sccn.ucsd.edu>
For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu<mailto:eeglablist-request at sccn.ucsd.edu>

_______________________________________________
Eeglablist page: https://urldefense.proofpoint.com/v2/url?u=https-3A__nam11.safelinks.protection.outlook.com_-3Furl-3Dhttp-253A-252F-252Fsccn.ucsd.edu-252Feeglab-252Feeglabmail.html-26amp-3Bdata-3D04-257C01-257Cpaul.anthony.beach-2540emory.edu-257C0b722fc7e739448d784408d94b91e9cc-257Ce004fb9cb0a4424fbcd0322606d5df38-257C0-257C0-257C637623912335473470-257CUnknown-257CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0-253D-257C2000-26amp-3Bsdata-3DfLXjzAa9m91R-252F-252ByjuahDtassQwod4ExW9nG7JACPUQU-253D-26amp-3Breserved-3D0&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=kB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE&m=1Rg8_2SDlukIFHUjJ7xZiB7EOiebyxrCtb3eLXqt-zA&s=jh7NdcqcCvAgb_EqEhXk3nF6WSNy9YTf6l3f2aSkFh8&e= 
To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu<mailto:eeglablist-unsubscribe at sccn.ucsd.edu>
For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu<mailto:eeglablist-request at sccn.ucsd.edu>



More information about the eeglablist mailing list