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

Last change on this file was 509, checked in by smasson, 5 years ago

commit old minor bugfix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 KB
RevLine 
[2]1;+
2;
[142]3; @file_comments
4; allows to trace the independently from a graph
[378]5;
[495]6; By default, trace a color bar of the same type than the one present in
[237]7; <pro>plt</pro>
8; and <pro>pltz</pro>.
[378]9;
[237]10; If max, min and divisions are not stipulated, then max=sup,min=inf
[142]11; and divisions=div.
[2]12;
[142]13; @categories
[157]14; Graphics
[2]15;
[142]16; @param POS
[231]17; Vector composed by 4 elements giving coordinates of the left bottom
[142]18; corner and of the right up one -in cm- in which we want to do the color bar
[2]19;
[231]20; @keyword _EXTRA
21; Used to pass keywords
[2]22;
[142]23; @uses
[370]24; <pro>common</pro>
[2]25;
[142]26; @restrictions
[163]27; Only usable for Postscripts effectuated with plein2dessin
[2]28;
[142]29; @history
[157]30; Sebastien Masson (smasson\@lodyc.jussieu.fr)
[142]31;                       7/5/98
[2]32;
[142]33; @version
34; $Id$
[2]35;
[237]36; @todo
[495]37; reference to plein2dessin in restriction not understand :
[237]38; plein2dessin does'nt exist.
39;
[2]40;-
[509]41PRO placecolor, pos, _EXTRA = ex
[114]42;
43  compile_opt idl2, strictarrsubs
44;
[37]45@cm_4ps
[509]46  IF NOT keyword_set(key_forgetold) THEN BEGIN
[37]47@updatenew
[509]48  ENDIF
[37]49;
[509]50  xsave = !x
51  ysave = !y
52  psave = !p
[37]53;
[509]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
[37]68;
[509]69  def_myuniquetmpdir
[37]70;
[509]71  IF lmgr(/demo) EQ 1 THEN BEGIN
[37]72; if we are in demo mode, we cannot save the parameters in a temporary file...
73@cm_demomode_used
74;
[509]75    colnumb = colorbarparam.colnumb
76    clbinf = colorbarparam.clbinf
77    clbsup = colorbarparam.clbsup
78    clbdiv = colorbarparam.clbdiv
[37]79;
[509]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
[37]88      ENDIF
[509]89    ENDIF
[37]90;
[509]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  ENDELSE
[231]96;
[509]97  !x = xsave
98  !y = ysave
99  !p = psave
100;
101  return
[2]102end
Note: See TracBrowser for help on using the repository browser.