[FieldTrip] Plotting confidence intervals in multiplotER

Arti Abhishek mailtome.2113 at gmail.com
Wed Oct 5 07:57:01 CEST 2016


Dear Kousik,

Thank you very much for your help. I am not sure how to change the
"dat_sem" as you suggested. My grand averaged file has the fields as follows

GrandAvg_Target1 =

       avg: [132x601 double]
       var: [132x601 double]
       dof: [132x601 double]
      time: [1x601 double]
     label: {132x1 cell}
    dimord: 'chan_time'
       cfg: [1x1 struct]

I am a beginner in MATLAB and any help would be greatly appreciated.

Thanks,
Arti

On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy <sarathykousik at gmail.com>
wrote:

> Hey Arti,
>
> This is not such a trivial thing to solve. Here's a recipe I used. You
> need to find and edit two scripts. If this spurns any more interest, I'll
> initiate a 'bug' and try to send in a pull request. This is a dirty fix and
> in all probability will be considered blasphemy.  ;)
>
> 1. Find in ft_multiplotER
> <https://github.com/fieldtrip/fieldtrip/blob/master/ft_multiplotER.m#L704>
> :
> ft_plot_vector(xval, yval, 'width', width(m), 'height', height(m), 'hpos',
> layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim', [ymin ymax], 'color
> ', color, 'style', cfg.linestyle{i}, 'linewidth', cfg.linewidth, 'axis',
> cfg.axes, 'highlight', mask, 'highlightstyle', cfg.maskstyle, 'label',
> label, 'box', cfg.box, 'fontsize', cfg.fontsize);
> This basically calls a plotting function which in turn does the plotting
> for you. You need to send in the extra 'sem' or a 'ci' variable.
> Change this to:
> ft_plot_vector(xval, yval, 'ysem', ysem, 'width', width(m), 'height',
> height(m), 'hpos', layX(m), 'vpos', layY(m), 'hlim', [xmin xmax], 'vlim',
> [ymin ymax], 'color', color, 'style', cfg.linestyle{i}, 'linewidth',
> cfg.linewidth, 'axis', cfg.axes, 'highlight', mask, 'highlightstyle',
> cfg.maskstyle, 'label', label, 'box', cfg.box, 'fontsize', cfg.fontsize);
>
> 2. Find in ft_plot_vector
> <https://github.com/fieldtrip/fieldtrip/blob/1b624e4e84cfd9e99e99cb391c91e961a03eea07/plotting/ft_plot_vector.m#L318>
> :
> You need to first get the sem parameter from your data and setup so FT can
> see your sem or CI info. Follow the code here
> <https://github.com/sarathykousik/sefSourceAnalysis/blob/master/multiplotER-bounded.m> .
> Search for "data_sem" and fix those lines.
> Then:
> h = plot(hdat, vdat, style, 'LineWidth', linewidth, 'Color', color, '
> markersize', markersize, 'markerfacecolor', markerfacecolor);
> Change this to:
> [h hp ]= boundedline(hdat, vdat, vdat_sem);
>
> Boundedline
> <https://www.mathworks.com/matlabcentral/fileexchange/27485-boundedline-m>is
> a submission in the MATLAB file exchange. You can use any other thing.
>
>
> Good luck trying! :)
>
>
> --
> Regards,
> Kousik Sarathy, S
>
>
> On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek <mailtome.2113 at gmail.com>
> wrote:
>
>> Dear fieldtrip community,
>>
>> I was wondering whether there is a way to plot the confidence intervals
>> in the ERP plot? I see that this question was asked multiple times in the
>> discussion list before, but I could not find an answer to this.
>>
>> Thanks,
>> Arti
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161005/e894b5da/attachment-0001.html>


More information about the fieldtrip mailing list