[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to plot continuously shaded area?



Hello.   I've been tasked with making a smooth variation in color, from white
through yellow, orange, into red, as part of a plot.  The plot currently has a
white background, black axes, a grid, and black data points (lines connecting
them).  I draw these using a combination of the commands plot, oplot, and axis.

The request if for the upper part of the plot, starting about halfway up the Y
axis, to go gradually from white through the above mentioned colors into red by
the time it reaches the top of the plotting area.

I know how to load the color table with tvlct, and have used this in the past
(with the color keyword on oplot) to draw plots of different data sets in the
same plotting region.  I also know about polyfill, which I've used before to
shade rectangles.  However, polyfill seems to shade the entire rectangle with
only a single color.

Am I doomed to drawing multiple rectangles, each with a different color index,
and manually filling the color table with slightly different triples of R,G,B,
to accomplish my goal?  Or is there another way I don't yet know about?  I saw
there are shading routines, but these appear overpowering (3-D stuff I don't
need).  Hints appreciated.

I'm running IDL V5.2 on OpenVMS AXP V7.1-2.  I'm writing to the Z buffer, and
will eventually write the resultant plot to a GIF file (for now).  Thanks.

Lawrence Bleau
University of Maryland
Physics Dept., Space Physics Group
301-405-6223
bleau@umtof.umd.edu