Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)
lab = label_eastwest ( xe, nd );
function lab = label_eastwest ( xe, nd );
Probably written by Alexis Lau (no documentation).
1) Replaced "xe = rem ( xe, 360 )" with
"x = find(xe>360); xe(x) = xe(x) - ones(size(x)) * 360;"
The old version would produce two ticks and two labels at the
Greenwich Meridian in plots for entire latitude circles. This
caused an error in vers. 5, which expects tick positions to be
increasing.
2) Changed i1 definition, so that it nows also picks up the "360" values.
--------------------------------------- Todd Mitchell, July 1997
changed Todd's changes so that the 360 case doesn't occur in the first
place, i.e. Greenwich is now always 0.
(replaced x=find(xe>360) by x=find(xe>=360);
Christian Bantzer, 10/3/97
| This function calls | This function is called by |
|---|---|
function lab = label_eastwest ( xe, nd );
if exist('nd') ~= 1; nd = 20; end;
while any(xe<0); xe = xe + 360; end
x = find( xe>=360 );
if ~isempty(x); xe(x) = xe(x) - ones(size(x)) * 360; end
xw = 360 - xe;
ie = find ( xe>0 & xe<180 ); iw = find ( xe>180 & xe<360 );
i1 = find ( xe==0 | xe==180 | xe==360 );
labe = form_ticklabels ( xe, nd); [ nx, ne ] = size ( labe );
labw = form_ticklabels ( xw, nd ); [ nx, nw ] = size ( labw );
nl = max(ne,nw) + 1; lab = setstr( ' ' * ones(nx,nl) );
if ~isempty([i1 ie]);
e1 = max(1,nw-ne+1); lab([i1 ie],[e1:nl-1]) = labe([i1 ie],:);
end
if ~isempty(ie);
lab(ie,nl) = setstr('E'*ones(length(ie),1));
end
if ~isempty(iw);
w1 = max(1,ne-nw+1); lab(iw,[w1:nl-1]) = labw(iw,:);
lab(iw,nl) = setstr('W'*ones(length(iw),1));
end