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