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

Last change on this file since 495 was 495, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo; dupe empty lines; trailing blanks

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