function h=text_place(ii_left_right,ii_bottom_top,ident,fname,fsize,fweight)
%
% Prints text in corner of figure plot.
%
% Call h=text_place(ii_left_right,ii_bottom_top,ident,fname,fsize);
%
% ii_left_right     = 1 for left, 2 for right;
% ii_bottom_top     = 1 for bottom, 2 for top;
% ident             = Text to print;
% fname             = Font name (default='Arial');
% fsize             = Font size;
%
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
if nargin<4, fname='Arial'; end
if nargin<5, fsize=9; end
if nargin<6, fweight='Normal'; end
%
iilr=ii_left_right; iibt=ii_bottom_top; 
if strcmp(get(gca,'Ydir'),'reverse') iibt=3-iibt; end
if strcmp(get(gca,'Xdir'),'reverse') iilr=3-iilr; end
Ylim=get(gca,'Ylim'); 
Xlim=get(gca,'Xlim');
h=text(Xlim(iilr),Ylim(iibt),ident);
Hal={'Left','Right'}; Val={'Top','Bottom'};
set(h,'FontName',fname,'Fontsize',fsize,'HorizontalAl',Hal{ii_left_right}, ...
    'VerticalAl',Val{ii_bottom_top},'FontWeight',fweight); 
