[FieldTrip] Plotting confidence intervals in multiplotER

kousik sarathy sarathykousik at gmail.com
Thu Sep 15 09:39:16 CEST 2016


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160915/05e8b5dd/attachment-0002.html>


More information about the fieldtrip mailing list