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

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

english and nicer header (2a)

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