1 | ;+ |
---|
2 | ; |
---|
3 | ; @file_comments |
---|
4 | ; Add an axis when we do an oblique section in <pro>pltz</pro>, |
---|
5 | ; <pro>pltt</pro> |
---|
6 | ; or <pro>plt1d</pro> |
---|
7 | ; |
---|
8 | ; @categories |
---|
9 | ; Graphics |
---|
10 | ; |
---|
11 | ; @param ENDPOINTS {in}{required} |
---|
12 | ; Coordinate of extremities of the section |
---|
13 | ; |
---|
14 | ; @param TYPE {in}{required}{type=string} |
---|
15 | ; A string of two characters specifying the type of plot we do |
---|
16 | ; |
---|
17 | ; @param POSFENETRE {in}{required}{type=vector} |
---|
18 | ; The vector !p.position corresponding to the frame position of |
---|
19 | ; the drawing part of the plot. |
---|
20 | ; |
---|
21 | ; @uses |
---|
22 | ; common.pro |
---|
23 | ; |
---|
24 | ; @history |
---|
25 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
26 | ; |
---|
27 | ; @version |
---|
28 | ; $Id$ |
---|
29 | ; |
---|
30 | ;- |
---|
31 | ; |
---|
32 | PRO addaxe, endpoints, type, posfenetre, _EXTRA = ex |
---|
33 | ; |
---|
34 | compile_opt idl2, strictarrsubs |
---|
35 | ; |
---|
36 | @common |
---|
37 | ;--------------------------------------- |
---|
38 | IF strpos(type, 'x') NE -1 THEN BEGIN |
---|
39 | IF endpoints[1] EQ endpoints[3] THEN return |
---|
40 | IF key_onearth THEN BEGIN |
---|
41 | formeaxe0 = 'lonaxe' |
---|
42 | formeaxe1 = 'lataxe' |
---|
43 | titreaxe = 'latitude' |
---|
44 | ENDIF ELSE BEGIN |
---|
45 | formeaxe0 = '' |
---|
46 | formeaxe1 = '' |
---|
47 | titreaxe = 'j index' |
---|
48 | ENDELSE |
---|
49 | range = [endpoints[1], endpoints[3]] |
---|
50 | if endpoints[2] LT endpoints[0] THEN range = reverse(range) |
---|
51 | ENDIF ELSE BEGIN |
---|
52 | IF endpoints[0] EQ endpoints[2] THEN return |
---|
53 | IF key_onearth THEN BEGIN |
---|
54 | formeaxe0 = 'lataxe' |
---|
55 | formeaxe1 = 'lonaxe' |
---|
56 | titreaxe = 'longitude' |
---|
57 | ENDIF ELSE BEGIN |
---|
58 | formeaxe0 = '' |
---|
59 | formeaxe1 = '' |
---|
60 | titreaxe = 'i index' |
---|
61 | ENDELSE |
---|
62 | range = [endpoints[0], endpoints[2]] |
---|
63 | if endpoints[3] LT endpoints[1] THEN range = reverse(range) |
---|
64 | ENDELSE |
---|
65 | if type EQ 'yt' then BEGIN |
---|
66 | axis,yaxis=0,ytickformat=formeaxe0,color=0,ystyle = 1, _EXTRA = ex |
---|
67 | axis,yaxis=1,ytickformat=formeaxe1,color=0,ystyle = 1,ytitle=titreaxe, yrange = range, _EXTRA = ex |
---|
68 | ENDIF ELSE BEGIN |
---|
69 | axis,xaxis=0,xtickformat=formeaxe0,color=0,xstyle = 1,_EXTRA = ex |
---|
70 | axis,xaxis=1,xtickformat=formeaxe1,color=0,xstyle = 1,xtitle=titreaxe, xrange = range, _EXTRA = ex |
---|
71 | ENDELSE |
---|
72 | |
---|
73 | ;--------------------------------------- |
---|
74 | return |
---|
75 | end |
---|