Home > functions > plotfunc > vb_plot_meg_2D.m

vb_plot_meg_2D

PURPOSE ^

---

SYNOPSIS ^

function vb_plot_meg_2D(x,z,clim)

DESCRIPTION ^

 ---
 function vb_plot_meg_2D(pick,bexp,clim)

 Plot MEG spatial pattern

 2005-07-27 Taku Yoshioka
 ---

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function vb_plot_meg_2D(x,z,clim)
0002 % ---
0003 % function vb_plot_meg_2D(pick,bexp,clim)
0004 %
0005 % Plot MEG spatial pattern
0006 %
0007 % 2005-07-27 Taku Yoshioka
0008 % ---
0009 %
0010 % Copyright (C) 2011, ATR All Rights Reserved.
0011 % License : New BSD License(see VBMEG_LICENSE.txt)
0012 
0013 [phi,theta,r] = cart2sph(x(:,1),x(:,2),x(:,3));
0014 [xa,ya,za] = pol2cart(phi,0.5*pi-theta,r);
0015 xa = mean(xa)-xa;
0016 ya = mean(ya)-ya;
0017 dx = (max(xa)-min(xa))/200;
0018 dy = (max(ya)-min(ya))/200;
0019 r_max = max(sqrt(xa.^2+ya.^2));
0020 xaa = xa;
0021 yaa = ya;
0022 xa = [xa; (1.1*r_max*cos(0:0.02*pi:1.99*pi))'];
0023 ya = [ya; (1.1*r_max*sin(0:0.02*pi:1.99*pi))'];
0024 za = [z(:); zeros(100,1)];
0025 
0026 [X,Y,Z] = griddata(xa,ya,za,...
0027            (min(xa):dx:max(xa)),...
0028            (min(ya):dy:max(ya))','cubic');
0029 [C,h] = contourf(X,Y,Z,20);
0030 hold on;
0031 set(h,'EdgeColor','none');
0032 z_max = max(abs(Z(:)));
0033 v = (0.2*z_max):(0.4*z_max):(1.0*z_max);
0034 v = [-1*v(end:-1:1) v];
0035 [C,h] = contourf(X,Y,Z,v);
0036 set(h,'FaceColor','none');
0037 
0038 if nargin<=2, clim = [min(v) max(v)]; end; 
0039 caxis(clim);
0040 
0041 plot(xaa,yaa,'ko','MarkerSize',2); 
0042 set(gca,'XDir','reverse');
0043 set(gca,'YDir','reverse');

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005