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