[2] | 1 | ;+ |
---|
| 2 | ; |
---|
[231] | 3 | ; @file_comments |
---|
[370] | 4 | ; Same thing that bar_plot but compatible with the whole environment |
---|
| 5 | ; (<pro>common</pro> included) |
---|
[2] | 6 | ; |
---|
[157] | 7 | ; @categories Graphics |
---|
[2] | 8 | ; |
---|
[163] | 9 | ; @keyword COLORS {type=vector} |
---|
[142] | 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). |
---|
[2] | 14 | ; |
---|
[163] | 15 | ; @keyword COLORS {type=integer} |
---|
[231] | 16 | ; I gives color of all colorbars. (contrarily to colors |
---|
[142] | 17 | ; which is a vector giving the color of each colorbar). |
---|
[2] | 18 | ; |
---|
[142] | 19 | ; @keyword NOREINITPLT |
---|
[231] | 20 | ; We active it if we do not want environment variables !p, !x, !y, !z |
---|
[295] | 21 | ; to be reinitialized by the procedure <pro>reinitplt</pro> |
---|
[2] | 22 | ; |
---|
[142] | 23 | ; @keyword _EXTRA |
---|
[231] | 24 | ; Used to pass keyword |
---|
[2] | 25 | ; |
---|
[142] | 26 | ; @uses |
---|
[370] | 27 | ; <pro>common</pro> |
---|
[2] | 28 | ; |
---|
[231] | 29 | ; @restrictions |
---|
| 30 | ; If NOREINITPLT is not activated, all environment |
---|
[370] | 31 | ; variables !p, !x, !y, !z are reinitialized by the procedure <pro>reinitplt</pro> |
---|
[2] | 32 | ; |
---|
[142] | 33 | ; @examples |
---|
[2] | 34 | ; |
---|
[370] | 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 | ; |
---|
[142] | 39 | ; @history |
---|
[157] | 40 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
[2] | 41 | ; 10/10/1999 |
---|
[142] | 42 | ; |
---|
| 43 | ; @version |
---|
| 44 | ; $Id$ |
---|
| 45 | ; |
---|
[2] | 46 | ;- |
---|
[327] | 47 | PRO sbar_plot, values, COLORS=colors, NOREINITPLT=noreinitplt, _EXTRA=ex |
---|
[231] | 48 | ; |
---|
[114] | 49 | compile_opt idl2, strictarrsubs |
---|
| 50 | ; |
---|
[2] | 51 | @common |
---|
[296] | 52 | ; 1) I reinitialize the graphic environment (variables !x, !y and !p): |
---|
[231] | 53 | if NOT keyword_set(NOREINITPLT) then reinitplt, _extra = ex |
---|
| 54 | ; 2) I place the drawing on the screen like on the postscript |
---|
[2] | 55 | IF chkstru(ex, 'overplot')EQ 0 THEN placedessin, 'autre', _extra = ex |
---|
[231] | 56 | ; 3) Drawing |
---|
[69] | 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)) |
---|
[2] | 61 | ; |
---|
[69] | 62 | bar_plot, Values, background = !p.background, colors = col $ |
---|
[67] | 63 | , xstyle = 1, ystyle = 1, _extra = ex |
---|
[231] | 64 | ; 4) End of drawing |
---|
| 65 | terminedessin, _extra=ex |
---|
[2] | 66 | |
---|
| 67 | return |
---|
| 68 | end |
---|