reverse-shooting

Matlab scripts for reverse shooting
Log | Files | Refs | README

checkerboard.m (752B)


      1 % Checkerboard.m    
      2 %	Similar to PCOLOR, except allows my favorite modifications
      3 
      4 
      5 function y = checkerboard(y,bounds,colors,names);
      6 
      7 N = length(colors);
      8 caxis([0  max(colors)]);
      9 %%% %y=replace(y,y==0,NaN);
     10 %%% for i=1:N;
     11 %%% 	if i==1; y=replace(y,y<=bounds(1),-9999); end;
     12 %%% 	if (i>1)&(i<N);
     13 %%% 		y=replace(y,(y>bounds(i-1))&(y<=bounds(i)),-9999+i-1);
     14 %%% 	end;
     15 %%% 	if i==N; y=replace(y,y>bounds(N-1),-9999+N-1); end;
     16 %%% end; % for i
     17 %%% 
     18 %%% for i=1:N;
     19 %%% 	y=replace(y,y==-9999+i-1,colors(i));
     20 %%% end; % for i
     21 %%% %y=replace(y,isnan(y),-9999);
     22 [N,K]=size(y);
     23 y=[flipud(y) zeros(N,1)*min(colors); ones(1,K+1)*max(colors)];
     24 set(gca,'XTick',1:K);
     25 set(gca,'YTick',1:N);
     26 set(gca,'YTickLabels',flipud(names));
     27 
     28 view(0,90);
     29 surface(y);
     30 y=flipud(y);