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