/[MITgcm]/MITgcm_contrib/ESMF/global_ocean.128x64x15/diags_matlab/pcol.m
ViewVC logotype

Annotation of /MITgcm_contrib/ESMF/global_ocean.128x64x15/diags_matlab/pcol.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Feb 15 22:28:31 2004 UTC (21 years, 5 months ago) by cnh
Branch point for: MAIN, Initial
Initial revision

1 cnh 1.1 % Similar to pcolor except that pcol() doesn't drop the last column
2     % or row of data (ie. doesn't interpolated). It uses the shading flat
3     % method by default.
4     %
5     % See also PCOLOR, IMAGESC
6     function [hh] = pcol(varargin);
7    
8     %cmap=colormap;
9     %if cmap(size(cmap,1),:)==[0 0 0]
10     %else
11     % if sum(sum(isnan(data)))~=0
12     % colormap( [colormap' [0 0 0]']')
13     % end
14     %end
15    
16     % Scale data to fit colormap
17     %clim=[min(min(data)) max(max(data))];
18     %data=(data-clim(1))/(clim(2)-clim(1))*(size(colormap,1)-1)+1;
19     %data(find(isnan(data)==1))=size(colormap,1)+1;
20    
21     if nargin == 1
22     %hh=imagesc(data);
23     data=varargin{1};
24     pcolor(data([1:end 1],[1:end 1]))
25     % $$$ xtick = get(gca,'XTick')';
26     % $$$ ytick = get(gca,'YTick')';
27     % $$$ xt=xtick+.5;
28     % $$$ yt=ytick+.5;
29     else
30     %hh=imagesc(varargin{1:2},data);
31     x=varargin{1}(:);
32     y=varargin{2}(:);
33     data=varargin{3};
34     pcolor([x' 2*x(end)-x(end-1)],...
35     [y' 2*y(end)-y(end-1)],...
36     data([1:end 1],[1:end 1]))
37     % $$$ dx = diff(x);
38     % $$$ dy = diff(y);
39     % $$$ xtick = get(gca,'XTick'); %[x(1:end-1)+.5*dx; x(end)+.5*dx(end)];
40     % $$$ ytick = get(gca,'YTick'); %[y(1:end-1)+.5*dy; y(end)+.5*dy(end)];
41     % $$$ xt = interp1(x,[x(1:end-1)+.5*dx; x(end)+.5*dx(end)],xtick);
42     % $$$ yt = interp1(y,[y(1:end-1)+.5*dy; y(end)+.5*dy(end)],ytick);
43     end
44     %set(gca,'YDir','normal')
45     % fix tickmarks to emulate imagesc behavior
46     % $$$ dx = diff(x);
47     % $$$ dy = diff(y);
48     % $$$ set(gca,'XTick',xt,'XTickLabel',xtick)
49     % $$$ set(gca,'YTick',yt,'YTickLabel',ytick)
50     set(gca,'Layer','top')
51     shading flat;

  ViewVC Help
Powered by ViewVC 1.1.22