source: trunk/SRC/ToBeReviewed/PLOTS/DESSINE/scontour.pro @ 472

Last change on this file since 472 was 472, checked in by smasson, 13 years ago

bugfix in scontour with overplot keyword

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