source: trunk/SRC/ToBeReviewed/PLOTS/LABEL/lonaxe.pro @ 327

Last change on this file since 327 was 325, checked in by pinsard, 17 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 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 longitude.
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;-
33FUNCTION lonaxe, axis, index, value
34;------------------------------------------------------------
35; We put back value in the segment [0,360[
36;
37  compile_opt idl2, strictarrsubs
38;
39   lon=value mod 360
40   if lon lt 0 then lon=lon+360
41; format of labels:
42   case 1 of
43      lon EQ round(lon):fmt = 'i4'
44      10.*lon EQ round(10.*lon):fmt = 'f6.1'
45      ELSE:fmt = 'f7.2'
46   endcase
47; we write the label
48   if lon lt 180 then nom=string(lon,     format='('+fmt+',''E'')')
49   if lon gt 180 then nom=string(360-lon, format='('+fmt+',''W'')')
50   if lon eq 180 then nom=string(lon,     format='('+fmt+')')
51;
52   return, nom
53end
54
Note: See TracBrowser for help on using the repository browser.