<div dir="ltr"><div><div><div><div>Dear Kousik,<br><br></div>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<br><br>GrandAvg_Target1 = <br><br>       avg: [132x601 double]<br>       var: [132x601 double]<br>       dof: [132x601 double]<br>      time: [1x601 double]<br>     label: {132x1 cell}<br>    dimord: 'chan_time'<br>       cfg: [1x1 struct]<br><br></div>I am a beginner in MATLAB and any help would be greatly appreciated.<br><br></div>Thanks,<br></div>Arti<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 15, 2016 at 5:39 PM, kousik sarathy <span dir="ltr"><<a href="mailto:sarathykousik@gmail.com" target="_blank">sarathykousik@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Arti,<div><br></div><div>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.  ;) </div><div><br></div><div>1. Find in <a href="https://github.com/fieldtrip/fieldtrip/blob/master/ft_multiplotER.m#L704" target="_blank">ft_multiplotER</a>: <br></div><table class="m_1636334306557515117gmail-highlight m_1636334306557515117gmail-tab-size m_1636334306557515117gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",roboto,helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-LC704" class="m_1636334306557515117gmail-blob-code m_1636334306557515117gmail-blob-code-inner m_1636334306557515117gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;word-wrap:normal;white-space:pre-wrap;background-color:rgb(248,238,199)">  ft_plot_vector(xval, yval, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>width<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, <span class="m_1636334306557515117gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">width</span>(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>height<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, height(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>hpos<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, layX(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>vpos<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, layY(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>hlim<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, [xmin xmax], <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>vlim<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, [ymin ymax], <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>color<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, <span class="m_1636334306557515117gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">color</span>, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>style<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.linestyle{<span class="m_1636334306557515117gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">i</span>}, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>linewidth<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.linewidth, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>axis<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.axes, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>highlight<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, mask, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>highlightstyle<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.maskstyle, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>label<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, label, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>box<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.box, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>fontsize<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.fontsize);</td></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-L705" class="m_1636334306557515117gmail-blob-num m_1636334306557515117gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;line-height:20px;color:rgba(0,0,0,0.298039);text-align:right;white-space:nowrap;vertical-align:top;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td></tr></tbody></table>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.<div>Change this to:</div><div><table class="m_1636334306557515117gmail-highlight m_1636334306557515117gmail-tab-size m_1636334306557515117gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",roboto,helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-LC685" class="m_1636334306557515117gmail-blob-code m_1636334306557515117gmail-blob-code-inner m_1636334306557515117gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;word-wrap:normal;white-space:pre-wrap"><span style="background-color:rgb(255,242,204)">ft_plot_vector(xval, yval, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>ysem<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, ysem, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>width<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, <span class="m_1636334306557515117gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">width</span>(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>height<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, height(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>hpos<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, layX(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>vpos<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, layY(m), <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>hlim<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, [xmin xmax], <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>vlim<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, [ymin ymax], <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>color<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, <span class="m_1636334306557515117gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">color</span>, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>style<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.linestyle{<span class="m_1636334306557515117gmail-pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">i</span>}, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>linewidth<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.linewidth, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>axis<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.axes, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>highlight<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, mask, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>highlightstyle<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.maskstyle, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>label<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, label, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>box<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.box, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>fontsize<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, cfg.fontsize);</span></td></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-L686" class="m_1636334306557515117gmail-blob-num m_1636334306557515117gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;line-height:20px;color:rgba(0,0,0,0.298039);text-align:right;white-space:nowrap;vertical-align:top;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td></tr></tbody></table><br></div><div>2. Find in <a href="https://github.com/fieldtrip/fieldtrip/blob/1b624e4e84cfd9e99e99cb391c91e961a03eea07/plotting/ft_plot_vector.m#L318" target="_blank">ft_plot_vector</a>: </div><div>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 <a href="https://github.com/sarathykousik/sefSourceAnalysis/blob/master/multiplotER-bounded.m" target="_blank">here</a> . Search for "data_sem" and fix those lines. </div><div>Then: </div><div><table class="m_1636334306557515117gmail-highlight m_1636334306557515117gmail-tab-size m_1636334306557515117gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",roboto,helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-LC318" class="m_1636334306557515117gmail-blob-code m_1636334306557515117gmail-blob-code-inner m_1636334306557515117gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;word-wrap:normal;white-space:pre-wrap;background-color:rgb(248,238,199)">h = <span class="m_1636334306557515117gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">plot</span>(hdat, vdat, style, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>LineWidth<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, linewidth, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>Color<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, <span class="m_1636334306557515117gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">color</span>, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>markersize<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, markersize, <span class="m_1636334306557515117gmail-pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span>markerfacecolor<span class="m_1636334306557515117gmail-pl-pds" style="box-sizing:border-box">'</span></span>, markerfacecolor);</td></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-L319" class="m_1636334306557515117gmail-blob-num m_1636334306557515117gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;line-height:20px;color:rgba(0,0,0,0.298039);text-align:right;white-space:nowrap;vertical-align:top;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td></tr></tbody></table>Change this to:</div><div><table class="m_1636334306557515117gmail-highlight m_1636334306557515117gmail-tab-size m_1636334306557515117gmail-js-file-line-container" style="box-sizing:border-box;border-collapse:collapse;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,"segoe ui",roboto,helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-LC322" class="m_1636334306557515117gmail-blob-code m_1636334306557515117gmail-blob-code-inner m_1636334306557515117gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;word-wrap:normal;white-space:pre-wrap"><span class="m_1636334306557515117gmail-pl-c" style="box-sizing:border-box;background-color:rgb(255,242,204)"><font color="#000000">[h hp ]= boundedline(hdat, vdat, vdat_sem);</font></span></td></tr><tr style="box-sizing:border-box"><td id="m_1636334306557515117gmail-L323" class="m_1636334306557515117gmail-blob-num m_1636334306557515117gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td></tr></tbody></table><br></div><div><a href="https://www.mathworks.com/matlabcentral/fileexchange/27485-boundedline-m" target="_blank">Boundedline </a>is a submission in the MATLAB file exchange. You can use any other thing.</div><div><br></div><div><br></div><div>Good luck trying! :)</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_1636334306557515117gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font color="#000000">--</font></div><div><font color="#000000">Regards,<br></font></div><div><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div style="text-align:left"><font color="#000000">Kousik Sarathy, S</font></div></span></div><div style="text-align:left"><br></div></div></div></div>
<br><div class="gmail_quote"><div><div class="h5">On Thu, Sep 15, 2016 at 7:36 AM, Arti Abhishek <span dir="ltr"><<a href="mailto:mailtome.2113@gmail.com" target="_blank">mailtome.2113@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div>Dear fieldtrip community,<br><br></div>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.<br><br></div>Thanks,<br></div>Arti<br></div>
<br></div></div>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>