/[MITgcm]/MITgcm_contrib/enderton/Diagnostics/DiagUtility/drawedges.m
ViewVC logotype

Contents of /MITgcm_contrib/enderton/Diagnostics/DiagUtility/drawedges.m

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


Revision 1.1 - (show annotations) (download)
Mon Jan 31 15:43:28 2005 UTC (20 years, 5 months ago) by enderton
Branch: MAIN
CVS Tags: HEAD
 o Initial check in.

1 function [] = drawedges(xg,yg,varargin)
2 % Draws edges of cube on plot
3 % >> drawedges(xg,yg)
4
5 [nx ny nt]=size(xg);
6 hnx=ceil(nx/2);
7 hny=ceil(ny/2);
8
9 if ~isempty(varargin)
10 col=varargin{1};
11 else
12 col='k';
13 end
14
15 if ndims(xg)==2 & size(xg,1)==6*size(xg,2)
16 [nx ny nt]=size(xg);
17 x=permute( reshape(xg,[nx/6 6 ny]),[1 3 2]);
18 y=permute( reshape(yg,[nx/6 6 ny]),[1 3 2]);
19 [nx ny nt]=size(xg);
20 elseif ndims(xg)==3 & size(xg,2)==6
21 x=permute( X,[1 3 2]);
22 y=permute( Y,[1 3 2]);
23 [nx ny nt]=size(xg);
24 elseif ndims(xg)==3 & size(xg,3)==6
25 [nx ny nt]=size(xg);
26 x=xg;y=yg;
27 else
28 size(xg)
29 size(yg)
30 error('Dimensions should be 2 or 3 dimensions: NxNx6, 6NxN or Nx6xN');
31 end
32
33
34 for sh=-180:90:180;
35 for k=1:6;
36 h=line( longitude(x(:,1,k))+sh, y(:,1,k));set(h,'Color',col);
37 h=line( longitude(x(1,:,k))+sh, y(1,:,k));set(h,'Color',col);
38 end
39 end

  ViewVC Help
Powered by ViewVC 1.1.22