[Eeglablist] Plotting Standard Error

Cedric Cannard ccannard at protonmail.com
Sat Oct 31 10:33:37 PDT 2020


Hi Aoife,

Here is a simple function that does that using Matlab's fill function. You can adjust colors playing with RGB values as in example below.
Like normal plots, you can use hold on to superimpose other plots with the shaded SDs as well (see below).

For example:
figure;
myfillfunction(lags,mean(waveform_all(elecs,:,:),3),std(waveform_all(elecs,:,:)./sqrt(N_subjects),[],3),'r',[1 0.7 0.7]);
hold on;
myfillfunction(lags,mean(waveform_all2(elecs,:,:),3),std(waveform_all2(elecs,:,:)./sqrt(N_subjects),[],3),[0.5 0.5 0.5],[0.8 0.8 0.8]);
hold off;

I hope this helps.


Cedric

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, October 31, 2020 9:17 AM, Aoife Sweeney <asweeney16 at qub.ac.uk> wrote:

> Hi there,
>
> I'm trying to add the standard error of the mean to my grand average waveform plots. I have processed everything through EEGLAB and have calculated what the SEM is, however I can't seem to figure out how to add this onto plot as a shaded line surrounding the waveform.
>
> Any tips or advice would be great!
>
> Best regards,
> Aoife
>
> 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

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: myfillfunction.m
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20201031/45f14cae/attachment.ksh>


More information about the eeglablist mailing list