<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<span style="caret-color: rgb(255, 255, 255);" class="">Hi Christina,</span>
<div style="caret-color: rgb(255, 255, 255);" class=""><br class="">
</div>
<div style="caret-color: rgb(255, 255, 255);" class="">I believe that your question is twofold:</div>
<div style="caret-color: rgb(255, 255, 255);" class=""><br class="">
</div>
<div style="caret-color: rgb(255, 255, 255);" class="">1) how can I get the function to work? (I assume that you get an unreported error if you try and execute the code you pasted in your message)</div>
<div style="caret-color: rgb(255, 255, 255);" class="">2) can I plot an average + confidence interval for my data?</div>
<div style="caret-color: rgb(255, 255, 255);" class=""><br class="">
</div>
<div style="caret-color: rgb(255, 255, 255);" class="">@1): you probably need to adjust data.label to be a cell-array, i.e. {’some-name’}, rather than ’some-name’, it could be that FieldTrip chokes on this.</div>
<div style="caret-color: rgb(255, 255, 255);" class="">@2): at the moment, this is not possible. Thus, at the moment you can only plot the average + mask. Adding support for SEM/std/quantiles is something we recently started discussing on github, <a href="https://github.com/fieldtrip/fieldtrip/issues/1558" class="">https://github.com/fieldtrip/fieldtrip/issues/1558</a> but
 nobody has followed up on this (yet), probably because this is a technically hairy issue.</div>
<div style="caret-color: rgb(255, 255, 255);" class=""><br class="">
</div>
<div style="caret-color: rgb(255, 255, 255);" class="">Best wishes,</div>
<div style="caret-color: rgb(255, 255, 255);" class="">Jan-Mathijs</div>
<div style="caret-color: rgb(255, 255, 255);" class=""><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 5 Mar 2021, at 18:59, Christina Vanden Bosch der Nederlanden <<a href="mailto:christinavb@gmail.com" class="">christinavb@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hello!
<div class=""><br class="">
</div>
<div class="">I have been plotting my coherence data using Matlab's built-in plot functions, but I'd like to take advantage of fieldtrip's cfg.maskparameters for graphing significant regions of coherence in my data. I want to plot the average coherence across
 subjects and then make the thickness of the line represent significant regions. I'm trying to "trick" fieldtrip into thinking that my datatype is freq, but it won't let me plot just the average (and I read that maskparameter is omitted when trying to average
 over repetitions). So how do I trick fieldtrip into plotting my data as an average across participants, with std error bars AND the mask parameter for sig regions of coherence (x-axis: freq, y-axis: coherence).</div>
<div class=""><br class="">
</div>
<div class=""><font face="arial, sans-serif" class="">data = </font></div>
<div class=""><font face="arial, sans-serif" class="">struct with fields:</font></div>
<div class="">
<div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="">
powspctrm: [33×790 double] %this is actually participants_freq<br class="">
          avg: [1×790 double] %avg across all participants for all freqs</div>
<div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="">
    stderror: [1×790 double] %stderror across all participants for all freqs<br class="">
       dimord: 'chan_freq'<br class="">
         freq: [1×790 double]<br class="">
       sigreg: [1×790 logical] %0's for nonsig 1's for sig<br class="">
        label: 'E25' %just put in a random chan label to trick ft into thinking this was a 'chan_freq' datatype resulting from ft_freqanalysis<br class="">
</div>
<div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; font-stretch: normal; line-height: normal;" class="">
<font face="arial, sans-serif" class=""><br class="">
</font></div>
</div>
<div class=""><font face="arial, sans-serif" class="">cfg = [ ];<br class="">
cfg.parameter = 'avg';<br class="">
cfg.maskparameter = 'sigreg';<br class="">
cfg.maskstyle = 'thickness'<br class="">
cfg.title = 'All conditions, sig coherence';<br class="">
ft_singleplotER(cfg, data)<br clear="all" class="">
</font>
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">Christina M. Vanden Bosch der Nederlanden</div>
<div class="">Postdoctoral Fellow</div>
<div class="">Brain and Mind Institute</div>
<div class="">Western University<br class="">
<a href="mailto:christinavb@gmail.com" target="_blank" class="">christinavb@gmail.com</a></div>
<div class=""><span style="font-size:12.8px" class="">Website: </span><a href="https://sites.google.com/view/christinavbdn" style="font-size:12.8px" target="_blank" class="">https://sites.google.com/view/christinavbdn</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div hspace="streak-pt-mark" style="max-height:1px" class=""><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aY2hyaXN0aW5hdmJAZ21haWwuY29t&type=zerocontent&guid=50ce631f-6362-463f-af7d-2eb80b778864" class=""><font color="#ffffff" size="1" class="">ᐧ</font></div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</body>
</html>