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

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

improvements of headers (typo, links, paragraphes, etc)

  • 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;
[237]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>.
[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
37; reference to plein2dessin in restriction not understable :
38; plein2dessin does'nt exist.
39;
[2]40;-
[327]41PRO placecolor, pos, _EXTRA=ex
[114]42;
43  compile_opt idl2, strictarrsubs
44;
[37]45@cm_4ps
46   IF NOT keyword_set(key_forgetold) THEN BEGIN
47@updatenew
48   ENDIF
49;
[2]50   xsave = !x
51   ysave = !y
52   psave = !p
[37]53;
[2]54   reinitplt, /z, /invert
55   pos=1.*pos
[37]56   mipgsz = min(page_size, max = mapgsz)
[2]57   if key_portrait eq 1 then begin
[231]58      pos[0]=pos[0]/mipgsz
59      pos[1]=pos[1]/mapgsz
60      pos[2]=pos[2]/mipgsz
61      pos[3]=pos[3]/mapgsz
[2]62   endif else begin
[231]63      pos[0]=pos[0]/mapgsz
64      pos[1]=pos[1]/mipgsz
65      pos[2]=pos[2]/mapgsz
66      pos[3]=pos[3]/mipgsz
[37]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
[231]76      clbinf = colorbarparam.clbinf
[37]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
[231]83         restore, file
84         if size(ex, /type) EQ 8 then BEGIN
[37]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;
[2]97   !x = xsave
98   !y = ysave
99   !p = psave
[231]100;
[2]101   return
102end
Note: See TracBrowser for help on using the repository browser.