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

Last change on this file since 163 was 163, checked in by navarro, 18 years ago

header improvements : type of parameters and keywords, default values, spell checking + idldoc assistant (IDL online_help)

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