<div dir="ltr">Hi Daniel,<div><br></div><div>Alternatively, you could use contourf instead of the default fieldtrip plotting function. This function has more flexibility for rescaling of axes than the imagesc function. From the ft_freqanalysis result, extract a time-by-frequency matrix, and then simply make your own figure:</div><div><br></div><div>figure;</div><div>contourf(cfg.toi, cfg.foi, TFR.powspctrm(chanidx,:,:),40,'linestyle','none');</div><div>set(gca,'yscale','log','ytick',[2 4 8 16 32 64]);</div><div><br></div><div>The chanidx is the channel you want to plot; the value 40 is the smoothness of the contours, and here it is plotted without lines between the contours (default is 'yes'). The set(gca... part changes the y-axis scaling, irrespective of whether your frequencies were logarithmically spaced in your analysis.</div><div><br></div><div>Chrs,</div><div>Joram</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 6, 2015 at 6:02 PM, Daniel Hähnke <span dir="ltr"><<a href="mailto:daniel.haehnke@lrz.tu-muenchen.de" target="_blank">daniel.haehnke@lrz.tu-muenchen.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Dear Philip,<div><br></div><div>you’re right, my question is about the equal spacing of the y-axis.</div><div><br></div><div>Thanks for the suggestion! I was just using the same line of thought to change the code of ft_singleplotTFR, but your approach is much safer than messing around with fieldtrip code ;)</div><div><br></div><div>All the best,</div><div><br></div><div>Daniel<br><div><blockquote type="cite"><div>On 06 Jul 2015, at 17:54, Philipp Ruhnau <<a href="mailto:mail@philipp-ruhnau.de" target="_blank">mail@philipp-ruhnau.de</a>> wrote:</div><br><div><div style="word-wrap:break-word">Dear Daniel,<div>you can plot TFRs with logarithmic axes yes, by just using ft_multiplotTFR or ft_singleplotTFR with your logspace TF data</div><div>but I think you’re question is about equally spacing the image? </div><div><br></div><div>if so you can ’trick’ fieldtrip, or better matlabs imagesc which fieldtrip uses to plot, by changing the values in the data.freq field to a linearly increasing vector (1:1:numel(data.freq)) and then </div><div>either change the numeric values back in a graphic design software, </div><div>or you change the yticklabels in matlab. see snippets below (just tested this quickly so no guarantee)</div><div>hope this helps</div><div>philipp</div><div><br></div><div><div style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> <br></div><div style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> <br></div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">%assume you have a dataset 'data' which has a powspectrum field </div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% keep the original frequency axis</div><div style="margin:0px;font-size:10px;font-family:Courier">orig_freq_axis = data.freq;</div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% now create fake linear axis</div><div style="margin:0px;font-size:10px;font-family:Courier">data.freq = 1:numel(data.freq);</div><div style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> <br></div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% plot data with defaults (needs powspectrum)</div><div style="margin:0px;font-size:10px;font-family:Courier">cfg = [];</div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)"><span>cfg.channel = 1:10; </span>% average across first 10 channels</div><div style="margin:0px;font-size:10px;font-family:Courier">figure; ft_singleplotTFR(cfg, data)</div><div style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> <br></div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% get the y tick labels, which we can use as index for the original data</div><div style="margin:0px;font-size:10px;font-family:Courier">yLabels = get(gca, <span style="color:#b245f3">'YTickLabel'</span>);</div><div style="margin:0px;font-size:10px;font-family:Courier;min-height:12px"> <br></div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% find index and create new labels in a cell of strings</div><div style="margin:0px;font-size:10px;font-family:Courier">newYLabels = [];</div><div style="margin:0px;font-size:10px;font-family:Courier"><span style="color:#0433ff">for</span> i=1:numel(yLabels)</div><div style="margin:0px;font-size:10px;font-family:Courier">  ind = str2num(yLabels{i});</div><div style="margin:0px;font-size:10px;font-family:Courier">  newYLabels{i} = num2str(orig_freq_axis(ind));</div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(4,51,255)">end</div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(4,51,255);min-height:12px"> <br></div><div style="margin:0px;font-size:10px;font-family:Courier;color:rgb(37,153,45)">% now change the current labels to correct labels</div><div style="margin:0px;font-size:10px;font-family:Courier">set(gca, <span style="color:#b245f3">'YTickLabel'</span>, newYLabels')</div></div><div><br></div><div><br></div><div><br><div><blockquote type="cite"><div><div class="h5"><div>On 06 Jul 2015, at 16:09, Daniel Hähnke <<a href="mailto:daniel.haehnke@lrz.tu-muenchen.de" target="_blank">daniel.haehnke@lrz.tu-muenchen.de</a>> wrote:</div><br></div></div><div><div><div class="h5"><div style="word-wrap:break-word">Dear community,<div><br></div><div>I feel like this is a very basic question, but I have not found any solution here.</div><div><br></div><div>I’d like to plot my TFRs with a logarithmic frequency axis, as seen e.g. in <a href="http://www.pnas.org/content/106/50/21341.figures-only" target="_blank">http://www.pnas.org/content/106/50/21341.figures-only</a></div><div><br></div><div>Is there any way I can do this with fieldtrip? I know that I can logarithmically space the frequencies of interest, so this question is merely about plotting.</div><div><br></div><div>All the best,</div><div><br></div><div>Daniel</div></div></div></div>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></blockquote></div><br></div><br><br><div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><font color="#929292">--------------------------<br>Philipp Ruhnau, PhD<br>CIMeC - Center for Mind/Brain Sciences<br>Università degli Studi di Trento<br>via delle Regole, 101<br>38123 Mattarello (TN) - ITALY<br><br>phone: +39 0461 28 3083<br>fax: +39 0461 28 3066<br>homepage: <a href="http://sites.google.com/site/obobcimec" target="_blank">http://sites.google.com/site/obobcimec</a><br></font><br></div></div></div></div></div>
</div>
<br></div>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></blockquote></div><br></div></div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Joram van Driel, PhD<div>Postdoc @ Vrije Universiteit Amsterdam</div><div>Cognitive Psychology</div><div><br></div></div></div></div></div></div></div>
</div>