/[MITgcm]/MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/mycontourf.m
ViewVC logotype

Contents of /MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/mycontourf.m

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


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Tue Nov 11 18:08:08 2003 UTC (21 years, 8 months ago) by cnh
Branch: MAIN, initial
CVS Tags: baseline, HEAD
Changes since 1.1: +0 -0 lines
Checking in work done with Dimitri on high-resolution cube gridding and parallel 
communications. 
   o code is in a contrib experiment for now so we can continue collaborating
     on it. However most code is general and will be moved into main branch once 
     it is fully hardened.
   o There are README files in the contrib root and in the subdirectories that
     explain the contents

1 function [c,h]=mycoutourf(x,y,a,ci,varargin)
2 % mycontourf(x,y,a,ci)
3
4
5 % Choose contour levels
6 if prod(size(ci))==1
7 amin=min(min(a));
8 amax=max(max(a));
9 cmin=floor(amin/ci)*ci;
10 cmax=ceil(amax/ci)*ci;
11 if cmin==cmax
12 error(sprintf('cmin=cmax=%g',cmin));
13 end
14 if cmin<0 & cmax>0
15 cmax=max(abs([cmin cmax]));
16 cmin=-cmax;
17 end
18 CI=cmin:ci:cmax;
19 else
20 CI=ci;
21 end
22 cmin=min(CI);
23 cmax=max(CI);
24
25 [c,h]=contourf(x,y,a,CI,varargin{:});
26 caxis([cmin cmax]);

  ViewVC Help
Powered by ViewVC 1.1.22