PLOTCOLORFILL Name
PLOTCOLORFILL Author
Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
craigm@lheamail.gsfc.nasa.gov Purpose
Plots colorful bar charts Calling Sequence
PLOTCOLORFILL, x, y, COLOR=col, BOTTOM=bot, WIDTH=wid, ...
Description
PLOTCOLORFILL plots a colorful vertical bar chart. This may be
useful in cases where two dimensions of information need to be
conveyed in one plot. [ I use it to show total intensity as a
function of time on the vertical axis, and temperature is coded
with color. ]
Most aspects of the bars are configurable. The color is specified
by an array of colors, one for each bar. [ Alternatively, a
single color for the entire plot can be given. ] Also, one color
can be designated as transparent.
Stacked bar charts can be constructed using two calls to
PLOTCOLORFILL. See the example. Inputs
X, Y - Two arrays which give the X and Y position of the points.
In this style of plot, the x values should be monotonically
increasing, but not necessarily monospaced (see WIDTH).
Optional Inputs
NONE
Input Keyword Parameters
COLOR - an array giving the color of each bar, or alternatively a
scalar color for all of the bars. The current color table
is not changed. Default is color "1"
BOTTOM - normally the bottom of the bars is set to be zero. You
may either specify a scalar bottom value for all of the
bars, or an array giving the bottom of each bar
individually. See the example to see how stacked bar
charts can be constructed with this keyword.
WIDTH - sets the width of each bar, globally or individually.
Bars are centered on the "X" value, and extend 0.5 * WIDTH
to either side. Default is to assume monospacing, using
the separation between the first two x values. If only
one data value is present, then a width of 1 is used.
MIDPOINT - if set, then ignore the WIDTH keyword value, and
instead construct bin edges which lie at the midpoints
between data points. This is usually the most
straightforward way to connect irregularly sampled
points "like a histogram," although at the expense of
not having a direct relation between X and the bin
centers.
NOERASE - if set, do not erase an existing plot before rendering
colored histogram. The effect is comparable to "OPLOT",
or the OVER keyword to CONTOUR.
NOTRACE - if set, do not draw a linear trace at the top of the
histogram.
TRANSPARENT - designates a color which is "transparent". Any bars
with this color are simply not rendered. Default is
no transparent color.
PANEL, SUBPANEL - An alternate way to more precisely specify the
plot and annotation positions. See SUBCELL.
Default is full-screen.
POSITION - Position of the bar chart in normal coordinates.
Overrides position given by PANEL/SUBPANEL.
Other keywords are passed to the plot command directly.
Outputs
NONE
Procedure
Example
Stacked barcharts can be constructed by first making one chart
with a flat bottom, and then a second chart whose bottom is top of
the first.
x = findgen(30)
y1 = x^2
y2 = 400.-x
c1 = bindgen(30)*3+1b
c2 = 100b-bindgen(30)*3+1b
plotcolorfill, x, y1, color=c1, bottom=0.
plotcolorfill, x, y1+y2, color=c2, bottom=y1, /noerase
See Also
PLOTPAN
EXTERNAL SUBROUTINES:
SUBCELL, DEFSUBCELL, PLOTPAN
Modification History
Written, CM, 1997
Added NOERASE, NOTRACE and MIDPOINT keywords, CM 11 Feb 2000
Logarithmic plots now work; so does the THICK keyword, CM 02 Apr
2001
Optimize drawing when the bin is zero, CM 04 Apr 2001
Try to handle YRANGE more properly, since there seem to be some
cases where the overlayed axes were erroneous, CM 15 Mar 2002
This time YRANGE tweaking with PANELs, CM 13 Jun 2002