;+
;
; @file_comments
; allows to trace the independently from a graph
; By default, trace a color bar of the same type than the one present in
; plt
; and pltz.
; If max, min and divisions are not stipulated, then max=sup,min=inf
; and divisions=div.
;
; @categories
; Graphics
;
; @param POS
; Vector composed by 4 elements giving coordinates of the left bottom
; corner and of the right up one -in cm- in which we want to do the color bar
;
; @keyword _EXTRA
; Used to pass keywords
;
; @uses
; common.pro
;
; @restrictions
; Only usable for Postscripts effectuated with plein2dessin
;
; @history
; Sebastien Masson (smasson\@lodyc.jussieu.fr)
; 7/5/98
;
; @version
; $Id$
;
; @todo
; reference to plein2dessin in restriction not understable :
; plein2dessin does'nt exist.
;
;-
;
PRO placecolor, pos, _EXTRA = ex
;
compile_opt idl2, strictarrsubs
;
@cm_4ps
IF NOT keyword_set(key_forgetold) THEN BEGIN
@updatenew
ENDIF
;
xsave = !x
ysave = !y
psave = !p
;
reinitplt, /z, /invert
pos=1.*pos
mipgsz = min(page_size, max = mapgsz)
if key_portrait eq 1 then begin
pos[0]=pos[0]/mipgsz
pos[1]=pos[1]/mapgsz
pos[2]=pos[2]/mipgsz
pos[3]=pos[3]/mapgsz
endif else begin
pos[0]=pos[0]/mapgsz
pos[1]=pos[1]/mipgsz
pos[2]=pos[2]/mapgsz
pos[3]=pos[3]/mipgsz
ENDELSE
;
def_myuniquetmpdir
;
IF lmgr(/demo) EQ 1 THEN BEGIN
; if we are in demo mode, we cannot save the parameters in a temporary file...
@cm_demomode_used
;
colnumb = colorbarparam.colnumb
clbinf = colorbarparam.clbinf
clbsup = colorbarparam.clbsup
clbdiv = colorbarparam.clbdiv
;
ENDIF ELSE BEGIN
file = myuniquetmpdir + '4colorbar.dat'
IF file_test(file) THEN BEGIN
restore, file
if size(ex, /type) EQ 8 then BEGIN
if (where(tag_names(ex) EQ 'MIN'))[0] NE -1 then clbinf = ex.MIN
if (where(tag_names(ex) EQ 'MAX'))[0] NE -1 then clbsup = ex.MAX
if (where(tag_names(ex) EQ 'DIVISIONS'))[0] NE -1 then clbdiv = ex.DIVISIONS
ENDIF
;
COLORBAR, COLOR = 0, DIVISIONS = clbdiv, DISCRET = colnumb $
, cb_color = 0, POSITION = pos, MAX = clbsup $
, MIN = clbinf, cb_charsize = !p.charsize $
, _extra = ex
ENDIF
ENDELSE
;
!x = xsave
!y = ysave
!p = psave
;
return
end