[Eeglablist] PLotting erspdata using 'imagesc'

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Wed Feb 11 19:06:38 PST 2015


Dear Katherine,

Without running your code on the real Matlab, I think your code looks fine.
I would add 'axis xy' in the end. I've never tried imagesc(x,y,C) so I
don't know how log scale works... if your 'y' is already like
logspace(log10(3), log10(55), 50) for 3-55Hz 50 divisions, just provide 'y'
and it should work, no need to tweak further, I guess?

Makoto

On Sat, Feb 7, 2015 at 11:26 PM, Katherine R. Naish <naishek at mcmaster.ca>
wrote:

> Hi all,
>
> This is just a sanity-check (hopefully)...
>
> I use the following code to average ersp values across electrodes (the 3rd
> dimension of 'erspdata'), calculate p-values for significance of modulation
> from baseline, and plot significant ersps for each region:
>
> for reg=1:regions
>
> erspdata_regions{1,1}(:,:,reg,:) = mean(erspdata{1,1}(:,:,(reg*chanlength)
> - (chanlength-1):reg*chanlength,:),3); %average across electrodes within
> region
>
> pvals = std_stat({erspdata_regions{1,1}(:,:,reg,:)
> zeros(size(erspdata_regions{1,1}(:,:,reg,:))) }', 'condstats', 'on',
> 'mcorrect', 'fdr'); %significance of modulation
>
> tmpersp = mean(erspdata_regions{1,1}(:,:,reg,:),4); % average across
> subjects
>
> tmpersp(pvals{1}>0.05) = 0; % zero out non-significant values (without
> this line, plots all modulation)
>
> subplot(regions/2,2,reg)
>
> imagesc(ersptimes, erspfreqs, tmpersp, [zmin zmax]);
>
> end
>
> From what I understand, the 'imagesc' function takes the min and max
> values of 'erspfreqs' as the min and max values for the y-axis, but the
> yticks are evenly spaced between these values. So, where erspfreqs is on a
> log scale, the labels on the y-axis produced by imagesc are not accurate.
>
> Is that correct?
>
> Thank you,
> Katherine
>
> --
> Katherine R. Naish
> Social Brain, Body, & Action Lab
> Department of Psychology, Neuroscience & Behaviour
> McMaster University
> Hamilton, ON, CA
> (905) 525-9140 ext. 26755
> https://www.researchgate.net/profile/Katherine_Naish
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>



-- 
Makoto Miyakoshi
Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20150211/b8e8de16/attachment.html>


More information about the eeglablist mailing list