source: trunk/SRC/ToBeReviewed/PLOTS/DESSINE/sbar_plot.pro @ 370

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

improvemnts of headers (typo, links)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1;+
2;
3; @file_comments
4; Same thing that bar_plot but compatible with the whole environment
5; (<pro>common</pro> included)
6;
7; @categories Graphics
8;
9; @keyword COLORS {type=vector}
10; A vector, the same size as VALUES, containing the color index
11; to be used for each bar.  If not specified, the colors are
12; selected based on spacing the color indices as widely as
13; possible within the available colors (specified by D.N_COLORS).
14;
15; @keyword COLORS {type=integer}
16; I gives color of all colorbars. (contrarily to colors
17; which is a vector giving the color of each colorbar).
18;
19; @keyword NOREINITPLT
20; We active it if we do not want environment variables !p, !x, !y, !z
21; to be reinitialized by the procedure <pro>reinitplt</pro>
22;
23; @keyword _EXTRA
24; Used to pass keyword
25;
26; @uses
27; <pro>common</pro>
28;
29; @restrictions
30; If NOREINITPLT is not activated, all environment
31; variables !p, !x, !y, !z are reinitialized by the procedure <pro>reinitplt</pro>
32;
33; @examples
34;
35;   IDL> sbar_plot, indgen(10),small = [2,2,2],/rempli
36;   IDL> sbar_plot, indgen(10),small = [2,2,3],/noerase
37;   IDL> \@ps
38;
39; @history
40; Sebastien Masson (smasson\@lodyc.jussieu.fr)
41;                      10/10/1999
42;
43; @version
44; $Id$
45;
46;-
47PRO sbar_plot, values, COLORS=colors, NOREINITPLT=noreinitplt, _EXTRA=ex
48;
49  compile_opt idl2, strictarrsubs
50;
51@common
52; 1) I reinitialize the graphic environment (variables !x, !y and !p):
53   if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex
54; 2) I place the drawing on the screen like on the postscript
55   IF chkstru(ex, 'overplot')EQ 0 THEN placedessin, 'autre', _extra = ex
56; 3) Drawing
57   if n_elements(COLORS) NE 0 then BEGIN
58      if n_elements(COLORS) EQ n_elements(Values) then col = colors $
59       ELSE col = replicate(colors[0], n_elements(Values))
60   ENDIF ELSE col = congrid(indgen(!d.n_colors < 256), n_elements(Values))
61;
62   bar_plot, Values, background = !p.background, colors = col $
63             , xstyle = 1, ystyle = 1, _extra = ex
64; 4) End of drawing
65   terminedessin, _extra=ex
66
67   return
68end
Note: See TracBrowser for help on using the repository browser.