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

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME:LONAXE
6;
7; PURPOSE:fonction appelee par [XYZ]TICKFORMAT (cf l'help pour voir
8;         comment l'utiliser) pour labeller les axes en longitude.
9;
10; CATEGORY:graphe
11;
12; CALLING SEQUENCE:[XYZ]TICKFORMAT='lonaxe'
13;
14; INPUTS:fournis (et imposes) automatiquement par IDL: axis, index, value:
15;       Axis is the axis number: 0 for X axis, 1 for Y axis, 2 for Z axis.
16;       Index is the tick mark index which starts at 0.
17;       Value is the default tick mark value (a floating-point number).
18; KEYWORD PARAMETERS:
19;
20; OUTPUTS:un string, utilise automatiquement pour labeller
21;
22; COMMON BLOCKS:
23;
24; SIDE EFFECTS:
25;
26; RESTRICTIONS:
27;
28; EXAMPLE:
29;
30; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr)
31;                       ???
32;                       14/10/1999 format des labels
33;-
34;------------------------------------------------------------
35;------------------------------------------------------------
36;------------------------------------------------------------
37FUNCTION lonaxe, axis, index, value
38;------------------------------------------------------------
39; on ramenne value ds le segment [0,360[
40;
41  compile_opt idl2, strictarrsubs
42;
43   lon=value mod 360
44   if lon lt 0 then lon=lon+360
45; format des labels:
46   case 1 of
47      lon EQ round(lon):fmt = 'i4'
48      10.*lon EQ round(10.*lon):fmt = 'f6.1'
49      ELSE:fmt = 'f7.2'
50   endcase
51; on ecrit le label
52   if lon lt 180 then nom=string(lon,     format='('+fmt+',''E'')')
53   if lon gt 180 then nom=string(360-lon, format='('+fmt+',''W'')')
54   if lon eq 180 then nom=string(lon,     format='('+fmt+')')
55;
56   return, nom
57end
58
Note: See TracBrowser for help on using the repository browser.