[2] | 1 | ;------------------------------------------------------------ |
---|
| 2 | ;------------------------------------------------------------ |
---|
| 3 | ;------------------------------------------------------------ |
---|
| 4 | ;+ |
---|
| 5 | ; NAME:LATAXE |
---|
| 6 | ; |
---|
| 7 | ; PURPOSE:fonction appelee par [XYZ]TICKFORMAT (cf l'help pour voir |
---|
| 8 | ; comment l'utiliser) pour labeller les axes en latitude. |
---|
| 9 | ; |
---|
| 10 | ; CATEGORY:graphe |
---|
| 11 | ; |
---|
| 12 | ; CALLING SEQUENCE:[XYZ]TICKFORMAT='lataxe' |
---|
| 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 lataxe, axis, index, value |
---|
| 38 | ;------------------------------------------------------------ |
---|
| 39 | ; on ramenne value ds le segment [0,180] |
---|
[114] | 40 | ; |
---|
| 41 | compile_opt idl2, strictarrsubs |
---|
| 42 | ; |
---|
[2] | 43 | lat=value mod 360 |
---|
| 44 | if lat lt 0 then lat=lat+360 |
---|
| 45 | if lat gt 180 then lat=lat-180 |
---|
| 46 | ; format des labels: |
---|
| 47 | case 1 of |
---|
| 48 | lat EQ round(lat):fmt = 'i4' |
---|
| 49 | 10.*lat EQ round(10.*lat):fmt = 'f6.1' |
---|
| 50 | ELSE:fmt = 'f7.2' |
---|
| 51 | endcase |
---|
| 52 | ; on ecrit le label |
---|
| 53 | if lat le 90 and lat ne 0 then nom=string(lat, format='('+fmt+',''N'')') |
---|
| 54 | if lat gt 90 then nom=string(180-lat, format='('+fmt+',''S'')') |
---|
| 55 | if lat eq 0 then nom=string(lat, format='('+fmt+')') |
---|
| 56 | ; |
---|
| 57 | return, nom |
---|
| 58 | end |
---|
| 59 | |
---|