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

Last change on this file since 370 was 370, checked in by pinsard, 16 years ago

improvemnts of headers (typo, links)

  • 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; <pro>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;-
39PRO placecolor, pos, _EXTRA=ex
40;
41  compile_opt idl2, strictarrsubs
42;
43@cm_4ps
44   IF NOT keyword_set(key_forgetold) THEN BEGIN
45@updatenew
46   ENDIF
47;
48   xsave = !x
49   ysave = !y
50   psave = !p
51;
52   reinitplt, /z, /invert
53   pos=1.*pos
54   mipgsz = min(page_size, max = mapgsz)
55   if key_portrait eq 1 then begin
56      pos[0]=pos[0]/mipgsz
57      pos[1]=pos[1]/mapgsz
58      pos[2]=pos[2]/mipgsz
59      pos[3]=pos[3]/mapgsz
60   endif else begin
61      pos[0]=pos[0]/mapgsz
62      pos[1]=pos[1]/mipgsz
63      pos[2]=pos[2]/mapgsz
64      pos[3]=pos[3]/mipgsz
65   ENDELSE
66;
67   def_myuniquetmpdir
68;
69   IF lmgr(/demo) EQ 1 THEN BEGIN
70; if we are in demo mode, we cannot save the parameters in a temporary file...
71@cm_demomode_used
72;
73      colnumb = colorbarparam.colnumb
74      clbinf = colorbarparam.clbinf
75      clbsup = colorbarparam.clbsup
76      clbdiv = colorbarparam.clbdiv
77;
78   ENDIF ELSE BEGIN
79      file = myuniquetmpdir + '4colorbar.dat'
80      IF file_test(file) THEN BEGIN
81         restore, file
82         if size(ex, /type) EQ 8 then BEGIN
83            if (where(tag_names(ex) EQ 'MIN'))[0] NE -1 then clbinf = ex.MIN
84            if (where(tag_names(ex) EQ 'MAX'))[0] NE -1 then clbsup = ex.MAX
85            if (where(tag_names(ex) EQ 'DIVISIONS'))[0] NE -1 then clbdiv = ex.DIVISIONS
86         ENDIF
87;
88         COLORBAR, COLOR = 0, DIVISIONS = clbdiv, DISCRET = colnumb $
89          , cb_color = 0, POSITION = pos, MAX = clbsup $
90          , MIN = clbinf, cb_charsize = !p.charsize $
91          , _extra = ex
92      ENDIF
93   ENDELSE
94;
95   !x = xsave
96   !y = ysave
97   !p = psave
98;
99   return
100end
Note: See TracBrowser for help on using the repository browser.