# [Eeglablist] Plotting standard error shades on ERP

Mon Jul 19 12:26:23 PDT 2021

```You can also do that at the study level

https://urldefense.proofpoint.com/v2/url?u=https-3A__eeglab.org_tutorials_11-5FScripting_command-5Fline-5Fstudy-5Ffunctions.html-23plotting-2Dmeasures&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=kB5f6DjXkuOQpM1bq5OFA9kKiQyNm1p6x6e36h3EglE&m=zCZzq_wBqEWelhXHg4ghBGQxhsI5nrsj21I5XvAbfEw&s=fHR7S_E50Bt_7j1SYgG_GXVumlWP0DBLPFCl5m8Na9I&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> 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];
>
> 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> 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.
>>
>>
>> the sender by reply e-mail message and destroy all copies of the
>>
>> original message (including attachments).
>>
>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>
>> To unsubscribe, send an empty email to 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
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to 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

```