Documentation of frame


Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)


Function Synopsis

frame ( arg1, arg2 ) ;

Help text

 function frame ( arg1, arg2 ) ;

 script to define the rectangular graphics window boundaries.
 it also defines the global variable FRAME

 ******************************************************************
  It is important to call make sure FRAME is set right
  before using DRAWCOASTS, CY_CONTOUR and SET_ASPECT.
  This routine uses the global variable FRAME to set parameters
 ******************************************************************

 If call without any argument, it would revert to the frame defined
   by the last call to it; if call the first time without argument,
   frame will be set to [ 0 360 -90 90 ];

 SEE ALSO : axis, polar_frame

Cross-Reference Information

This function is called by

Listing of function frame

function frame ( arg1, arg2 ) ;

 
%---------------------------------------------- Alexis Lau (May 1991)

global FRAME MAP_ASPECT

if nargin==2;
  FRAME = [ arg1(1) arg1(length(arg1)) arg2(1) arg2(length(arg2)) ];
elseif nargin==1;
  FRAME = arg1;
elseif isempty(FRAME);
  FRAME = [ 0. 360. -90. 90. ];
end;

asps = get(gca,'AspectRatio');
if isnan(asps(1))
  MAP_ASPECT = 0;
else
  MAP_ASPECT = 1 / asps(1);
end

% ***** the followind statement could cause a silly bug **********
% FRAME = [ sort(FRAME([1 2])')' sort(FRAME([3 4])')' ];
% ***** Replaced by **********************************************
if FRAME(2)<FRAME(1); FRAME([1 2]) = FRAME([2 1]); end
if FRAME(4)<FRAME(3); FRAME([3 4]) = FRAME([4 3]); end
axis(FRAME);

%%% the following fixes a bug in matlab on white background
tc = get(get(gca,'title'),'color');
if all(tc==1) % white title
  set(get(gca,'title'),'color','black');
end;