1 | ;------------------------------------------------------------ |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ;------------------------------------------------------------ |
---|
4 | ;+ |
---|
5 | ; |
---|
6 | ; @file_comments |
---|
7 | ; Same thing that contour but compatible with the whole environment (common.pro included) |
---|
8 | ; |
---|
9 | ; @categories |
---|
10 | ; Graphics |
---|
11 | ; |
---|
12 | ; @keyword NOREINITPLT |
---|
13 | ; We active it if we do not want environment variables !p, !x, !y, !z |
---|
14 | ; to be reinitilalizated by the procedure reinitplt |
---|
15 | ; |
---|
16 | ; @keyword _EXTRA |
---|
17 | ; used to pass your keywords |
---|
18 | ; |
---|
19 | ; @uses |
---|
20 | ; common.pro |
---|
21 | ; |
---|
22 | ; @examples |
---|
23 | ; IDL> z = dist(100) |
---|
24 | ; IDL> scontour, z, nlevels=10,small=[1,2,1],xstyle=1,ystyle=1 |
---|
25 | ; IDL> \@ps |
---|
26 | ; |
---|
27 | ; @history |
---|
28 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
29 | ; 10/10/1999 |
---|
30 | ; |
---|
31 | ; @version |
---|
32 | ; $Id$ |
---|
33 | ; |
---|
34 | ;- |
---|
35 | ;------------------------------------------------------------ |
---|
36 | ;------------------------------------------------------------ |
---|
37 | ;------------------------------------------------------------ |
---|
38 | PRO scontour, x, y, z, NOREINITPLT = noreinitplt, _EXTRA = ex |
---|
39 | ; |
---|
40 | compile_opt idl2, strictarrsubs |
---|
41 | ; |
---|
42 | @common |
---|
43 | ; 1) I reinitializate the graphic environment (variables !x, !y et !p): |
---|
44 | if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex |
---|
45 | ; 2) i put the drawing on the screen like on the postcript |
---|
46 | ; if ex contains norease and c_orientation keywords we force ex.noerase = 0 |
---|
47 | IF chkstru(ex, 'overplot') EQ 0 THEN placedessin, 'autre', _extra = ex |
---|
48 | ; fiddle when noerase is used with c_orentation... |
---|
49 | ; call contour with /nodata to get the graphic environment, then force |
---|
50 | ; noerase = 0 and overplot = 1 |
---|
51 | IF size(ex, /type) EQ 8 THEN BEGIN |
---|
52 | ; check if noerase is used with c_orentation |
---|
53 | alltags = strlowcase(tag_names(ex)) |
---|
54 | dummy = where(alltags EQ 'noerase', count1) |
---|
55 | dummy = where(alltags EQ 'c_orientation', count2) |
---|
56 | IF count1*count2 NE 0 THEN BEGIN |
---|
57 | case n_params() OF |
---|
58 | 1:contour, x, /nodata, _EXTRA = ex |
---|
59 | 2:contour, x, y, /nodata, _EXTRA = ex |
---|
60 | 3:contour, x, y, z, /nodata, _EXTRA = ex |
---|
61 | endcase |
---|
62 | ex.noerase = 0 |
---|
63 | ex = get_extra(/overplot, _extra = ex) |
---|
64 | noerase_orientation = 1 |
---|
65 | ENDIF |
---|
66 | ENDIF |
---|
67 | ; 3) je fais mon joli dessin |
---|
68 | case n_params() OF |
---|
69 | 1:contour, x, xstyle = 1, ystyle = 1, _EXTRA = ex |
---|
70 | 2:contour, x, y, xstyle = 1, ystyle = 1, _EXTRA = ex |
---|
71 | 3:contour, x, y, z, xstyle = 1, ystyle = 1, _EXTRA = ex |
---|
72 | ENDCASE |
---|
73 | ; fiddle when noerase is used with c_orentation... draw the contour axis |
---|
74 | IF keyword_set(noerase_orientation) THEN BEGIN |
---|
75 | ex.noerase = 1 |
---|
76 | ex.overplot = 0 |
---|
77 | case n_params() OF |
---|
78 | 1:contour, x, xstyle = 1, ystyle = 1, /nodata, _EXTRA = ex |
---|
79 | 2:contour, x, y, xstyle = 1, ystyle = 1, /nodata, _EXTRA = ex |
---|
80 | 3:contour, x, y, z, xstyle = 1, ystyle = 1, /nodata, _EXTRA = ex |
---|
81 | ENDCASE |
---|
82 | ENDIF |
---|
83 | ; 4) End of drawing |
---|
84 | terminedessin, _extra = ex |
---|
85 | |
---|
86 | return |
---|
87 | end |
---|