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 | ;------------------------------------------------------------ |
---|
37 | FUNCTION lonaxe, axis, index, value |
---|
38 | ;------------------------------------------------------------ |
---|
39 | ; on ramenne value ds le segment [0,360[ |
---|
40 | lon=value mod 360 |
---|
41 | if lon lt 0 then lon=lon+360 |
---|
42 | ; format des labels: |
---|
43 | case 1 of |
---|
44 | lon EQ round(lon):fmt = 'i4' |
---|
45 | 10.*lon EQ round(10.*lon):fmt = 'f6.1' |
---|
46 | ELSE:fmt = 'f7.2' |
---|
47 | endcase |
---|
48 | ; on ecrit le label |
---|
49 | if lon lt 180 then nom=string(lon, format='('+fmt+',''E'')') |
---|
50 | if lon gt 180 then nom=string(360-lon, format='('+fmt+',''W'')') |
---|
51 | if lon eq 180 then nom=string(lon, format='('+fmt+')') |
---|
52 | ; |
---|
53 | return, nom |
---|
54 | end |
---|
55 | |
---|