TFR plot uneven y-axis spacing

Ingrid Nieuwenhuis ingrid.nieuwenhuis at DONDERS.RU.NL
Tue May 26 15:23:53 CEST 2009


Hi Julian,



Yes indeed plotting with unevenly spaced axis is problematic in Matlab. The
problem lies in the image (and imagesc) Matlab functions that singleplotTFR
and multiplotTFR call. These functions assume evenly spaced axis, and they
just interpolate linearly between lowest and highest value. Therefore you
cannot trust the values next to the axis when you look at the blobs, because
they can be totally wrong (which you will see if you change the ylims, then
the blobs shift). To get around this we used uimage and uimagesc in
fieldtrip, which works around this problem by making new axis before calling
image and imagesc. This was hard to implement in the current version of
multiplotTFR, so there we only give a warning (we're working on
restructuring the plotting functions, so in the future hopefully this will
be also implemented in the multiplot functions). So although everything
seems to be going fine in multiplot, you can not trust the axis there,
because they are linearly interpolated!



So for the error in the singleplot function, there something is not going
right when making the new axis. We got the uimage and uimagesc functions as
free functions from the matlabcentral fileexchange (see url in the code).
You could try to debug, and see why the new axis making doesn't work. I hope
this helps to solve the problem, if not let me know, I could try to help
then.



Best Ingrid



  _____

From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Julian Keil
Sent: Tuesday, May 26, 2009 9:52 AM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] TFR plot uneven y-axis spacing



Hi everyone,



I performed a TFR-analysis with unevenly spaced frequency steps
(cfg.foi=[10.^(log10(2):((log10(100)-log10(2))/35):log10(100))];)

Now, when I try to plot the results with multiplotTFR, I get the warning,
that (one of the axis) is/are not evenly spaced. Nonetheless, the
multiplotTFR works fine.



The Probem arises, when I try to select single (or a number) of sensors to
be plotted. I then get the following error message:



??? Attempted to access c(22,1); index out of bounds because
size(c)=[21,101].



Error in ==> uimage at 128

            ce(j,i) = c(indi(end), indj(end));



Error in ==> uimagesc at 50

    hh = uimage(varargin{:},'CDataMapping','scaled');



Error in ==> singleplotTFR at 282

h = uimagesc(data.(cfg.xparam)(xidc), data.(cfg.yparam)(yidc), TFR,
[zmin,zmax]);



Error in ==> plotSelection at 343

               singleplotTFR(new_cfg, userData.data);



??? Error while evaluating figure WindowButtonUpFcn



Is there any way to work around this (I already tried defining the y-axis
with cfg.ylim)?

Thanks a lot



Julian





Dipl. Psych. Julian Keil



OBOB-Lab

University of Konstanz

Department of Psychology

P.O. Box D23

78457 Konstanz

Germany



Tel: ++49 - (0)7531 - 88 42 50

Fax: ++49 - (0)7531 - 88 28 91

Email: julian.keil at uni-konstanz.de

Homepage: http://www.uni-konstanz.de/obob













----------------------------------

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20090526/00766125/attachment-0001.html>


More information about the fieldtrip mailing list