source: trunk/SRC/ToBeReviewed/PLOTS/DIVERS/placecolor.pro @ 254

Last change on this file since 254 was 237, checked in by pinsard, 17 years ago

replace some print by some report in some .pro (continuation) + improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1;+
2;
3; @file_comments
4; allows to trace the independently from a graph
5; By default, trace a color bar of the same type than the one present in
6; <pro>plt</pro>
7; and <pro>pltz</pro>.
8; If max, min and divisions are not stipulated, then max=sup,min=inf
9; and divisions=div.
10;
11; @categories
12; Graphics
13;
14; @param POS
15; Vector composed by 4 elements giving coordinates of the left bottom
16; corner and of the right up one -in cm- in which we want to do the color bar
17;
18; @keyword _EXTRA
19; Used to pass keywords
20;
21; @uses
22; common.pro
23;
24; @restrictions
25; Only usable for Postscripts effectuated with plein2dessin
26;
27; @history
28; Sebastien Masson (smasson\@lodyc.jussieu.fr)
29;                       7/5/98
30;
31; @version
32; $Id$
33;
34; @todo
35; reference to plein2dessin in restriction not understable :
36; plein2dessin does'nt exist.
37;
38;-
39;
40PRO placecolor, pos, _EXTRA = ex
41;
42  compile_opt idl2, strictarrsubs
43;
44@cm_4ps
45   IF NOT keyword_set(key_forgetold) THEN BEGIN
46@updatenew
47   ENDIF
48;
49   xsave = !x
50   ysave = !y
51   psave = !p
52;
53   reinitplt, /z, /invert
54   pos=1.*pos
55   mipgsz = min(page_size, max = mapgsz)
56   if key_portrait eq 1 then begin
57      pos[0]=pos[0]/mipgsz
58      pos[1]=pos[1]/mapgsz
59      pos[2]=pos[2]/mipgsz
60      pos[3]=pos[3]/mapgsz
61   endif else begin
62      pos[0]=pos[0]/mapgsz
63      pos[1]=pos[1]/mipgsz
64      pos[2]=pos[2]/mapgsz
65      pos[3]=pos[3]/mipgsz
66   ENDELSE
67;
68   def_myuniquetmpdir
69;
70   IF lmgr(/demo) EQ 1 THEN BEGIN
71; if we are in demo mode, we cannot save the parameters in a temporary file...
72@cm_demomode_used
73;
74      colnumb = colorbarparam.colnumb
75      clbinf = colorbarparam.clbinf
76      clbsup = colorbarparam.clbsup
77      clbdiv = colorbarparam.clbdiv
78;
79   ENDIF ELSE BEGIN
80      file = myuniquetmpdir + '4colorbar.dat'
81      IF file_test(file) THEN BEGIN
82         restore, file
83         if size(ex, /type) EQ 8 then BEGIN
84            if (where(tag_names(ex) EQ 'MIN'))[0] NE -1 then clbinf = ex.MIN
85            if (where(tag_names(ex) EQ 'MAX'))[0] NE -1 then clbsup = ex.MAX
86            if (where(tag_names(ex) EQ 'DIVISIONS'))[0] NE -1 then clbdiv = ex.DIVISIONS
87         ENDIF
88;
89         COLORBAR, COLOR = 0, DIVISIONS = clbdiv, DISCRET = colnumb $
90          , cb_color = 0, POSITION = pos, MAX = clbsup $
91          , MIN = clbinf, cb_charsize = !p.charsize $
92          , _extra = ex
93      ENDIF
94   ENDELSE
95;
96   !x = xsave
97   !y = ysave
98   !p = psave
99;
100   return
101end
Note: See TracBrowser for help on using the repository browser.