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

Last change on this file since 163 was 163, checked in by navarro, 18 years ago

header improvements : type of parameters and keywords, default values, spell checking + idldoc assistant (IDL online_help)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
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 Sebastien Masson (smasson\@lodyc.jussieu.fr)
28;                      10/10/1999
29;
30; @version
31; $Id$
32;
33;-
34;------------------------------------------------------------
35;------------------------------------------------------------
36;------------------------------------------------------------
37PRO scontour, x, y, z, NOREINITPLT = noreinitplt, _EXTRA = ex
38;
39  compile_opt idl2, strictarrsubs
40;
41@common
42; 1) I reinitializate the graphic environment (variables !x, !y et !p):
43  if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex
44; 2) i put the drawing on the screen like on the postcript
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...
48; call contour with /nodata to get the graphic environment, then force
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
66; 3) je fais mon joli dessin
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
82; 4) End of drawing
83  terminedessin, _extra = ex
84
85  return
86end
Note: See TracBrowser for help on using the repository browser.