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

Last change on this file 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
RevLine 
[2]1;+
2;
[142]3; @file_comments
[495]4; function called by [XYZ]TICKFORMAT (see the help to see how to use it) to
[369]5; label axes in latitude.
[2]6;
[142]7; @categories
[157]8; Graphics
[495]9;
10; @param AXIS
[142]11; It is the axis number: 0 for X axis, 1 for Y axis, 2 for Z axis.
[2]12;
[142]13; @param INDEX
14; It is the tick mark index which starts at 0.
[369]15;
[142]16; @param VALUE
17; It is the default tick mark value (a floating-point number).
[2]18;
[142]19; @returns
20; A string, used automatically to label
[2]21;
[142]22; @history
[157]23; Sebastien Masson (smasson\@lodyc.jussieu.fr)
[142]24;                       ???
25;                       14/10/1999 format of labels
[2]26;
[142]27; @version
28; $Id$
[2]29;
30;-
31FUNCTION lataxe, axis, index, value
32;------------------------------------------------------------
[142]33; We put back value in the segment [0,180]
[114]34;
35  compile_opt idl2, strictarrsubs
36;
[2]37   lat=value mod 360
38   if lat lt 0 then lat=lat+360
39   if lat gt 180 then lat=lat-180
[142]40; format of labels:
[2]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
[142]46; we write the label
[2]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.