source: trunk/SRC/ToBeReviewed/PLOTS/LABEL/lataxe.pro @ 299

Last change on this file since 299 was 157, checked in by navarro, 18 years ago

header improvements + xxx doc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments
7; function called by [XYZ]TICKFORMAT (see the help to see how to use it) to label axes in latitude.
8;
9; @categories
10; Graphics
11;
12; @param AXIS
13; It is the axis number: 0 for X axis, 1 for Y axis, 2 for Z axis.
14;
15; @param INDEX
16; It is the tick mark index which starts at 0.
17;       
18; @param VALUE
19; It is the default tick mark value (a floating-point number).
20;
21; @returns
22; A string, used automatically to label
23;
24; @history
25; Sebastien Masson (smasson\@lodyc.jussieu.fr)
26;                       ???
27;                       14/10/1999 format of labels
28;
29; @version
30; $Id$
31;
32;-
33;------------------------------------------------------------
34;------------------------------------------------------------
35;------------------------------------------------------------
36FUNCTION lataxe, axis, index, value
37;------------------------------------------------------------
38; We put back value in the segment [0,180]
39;
40  compile_opt idl2, strictarrsubs
41;
42   lat=value mod 360
43   if lat lt 0 then lat=lat+360
44   if lat gt 180 then lat=lat-180
45; format of labels:
46   case 1 of
47      lat EQ round(lat):fmt = 'i4'
48      10.*lat EQ round(10.*lat):fmt = 'f6.1'
49      ELSE:fmt = 'f7.2'
50   endcase
51; we write the label
52   if lat le 90 and lat ne 0 then nom=string(lat,     format='('+fmt+',''N'')')
53   if lat gt 90              then nom=string(180-lat, format='('+fmt+',''S'')')
54   if lat eq  0              then nom=string(lat,     format='('+fmt+')')
55;
56   return, nom
57end
58
Note: See TracBrowser for help on using the repository browser.