function cdot(x,y,z,c,dot_size,label,range); % CDOT plots colored dots over the range of data % % Usage: cdot(x,y,z,c,dot_size,label,range); % % x=vector of x locations % y = vector of x locations % z = vector of z values % c = colormap % dot_size = Marker size for dots (e.g 8) % label = 1 to label with value, 0 otherwise % range = range of data for colormap % % example % [x,y,z]=peaks(20);cdot(x(:),y(:),z(:),jet,20,1,[-8 8]) % if nargin < 7, range = []; end % ZYDECO. [m,n]=size(c); ndots=length(z); zsave=z; if (nargin > 6), % ZYDECO. zmin=range(1); zmax=range(length(range))+eps; iz=find(z>=zmax); if(~isempty(iz)), z(iz)=(zmax-eps)*ones(size(iz)); end iz=find(z=z1& z<=z2); line(x(ind),y(ind),'linestyle','none','marker','.','markersize',... dot_size,'color',c(i,:)); end if(label==1); for i=1:ndots % text(x(i),y(i),sprintf(' %d',zsave(i)),'fontsize',14,... text(x(i),y(i),sprintf('%5.1f',zsave(i)),... 'HorizontalAlignment','left','VerticalAlignment','bottom') % bgtext(x(i),y(i),sprintf(' %d',zsave(i)),[1 1 .9],'fontsize',10,... % bgtext(x(i),y(i),sprintf(' %d',zsave(i)),[1 1 .9]); end end