Multiple colors in one plot statement [message #5703] |
Wed, 07 February 1996 00:00  |
eparvier
Messages: 4 Registered: October 1991
|
Junior Member |
|
|
Does anyone know of a way to get around the limitation that
the COLOR keyword for the PLOT command only takes a scalar?
I want to plot a bunch of points, with coordinates contained
in the vectors X and Y, but I want the color of each of the
points to correspond to information contained in another
vector Z (same length as X and Y, but scaled in value to
match the size of the color table of choice). Using the
command:
PLOT, X, Y, PSYM=2, COLORS=Z
doesn't work because COLORS can only be a scalar. The work-
around that I came up with involves having to plot each of
the individual elements one-by-one with a series of OPLOT
statements, setting the color individually. Is there a
separate keyword analagous to the C_COLORS in CONTOUR or
the SHADES keyword in SHADE_SURF, but for PLOT? Or is
there a command or routine that I'm not aware of that
will do what I want?
It would also be nice to be able to make each of the arrows
created by VELOVECT an aribitrary color described by a
separate color array all in one fell swoop instead of
using repeated calls to the routine.
Anyone have any ideas?
Thanks,
Frank
------------------------------------------------------------ --------
Frank Eparvier, Research Associate Work: (303)497-7394
NOAA Space Environment Center Home: (303)673-0913
University of Colorado - CIRES
E-mail: eparvier@colorado.edu
WWW: http://stripe.colorado.edu/~eparvier/Home.html
------------------------------------------------------------ --------
|
|
|
Re: Multiple colors in one plot statement [message #5785 is a reply to message #5703] |
Thu, 08 February 1996 00:00  |
Jackel
Messages: 30 Registered: April 1993
|
Member |
|
|
In article <4fb1p2$cbp@peabody.colorado.edu> eparvier@stripe.Colorado.EDU (Eparvier Francis) writes:
> Does anyone know of a way to get around the limitation that
> the COLOR keyword for the PLOT command only takes a scalar?
From the version 4.0.1 help
"The PLOTS procedure plots vectors or points on the current graphics device in
either two or three dimensions. The coordinates can be given in data, device,
or normalized form using the DATA (the default), DEVICE, or NORMAL keywords.
The COLOR keyword can be set to a scalar or vector value. If it is set to a vector value,
the line segment connecting (Xi, Yi) to (Xi+1, Yi+1) is drawn with a color
index of COLORi+1. In this case, COLOR must have the same number of elements
as X and Y."
So you might try making the plot area, then using PLOTS to draw the points.
> It would also be nice to be able to make each of the arrows
> created by VELOVECT an aribitrary color described by a
> separate color array all in one fell swoop instead of
> using repeated calls to the routine.
VELOVECT is a user contributed routine, so the source is available to change,
or you could write a wrapper routine (VELOVECTS?) which looped for you.
Brian Jackel
University of Western Ontario
|
|
|
Re: Multiple colors in one plot statement [message #5786 is a reply to message #5703] |
Thu, 08 February 1996 00:00  |
paul
Messages: 22 Registered: June 1991
|
Junior Member |
|
|
In article <4fb1p2$cbp@peabody.colorado.edu>, eparvier@stripe.Colorado.EDU (Eparvier Francis) writes:
|> Does anyone know of a way to get around the limitation that
|> the COLOR keyword for the PLOT command only takes a scalar?
|> I want to plot a bunch of points, with coordinates contained
|> in the vectors X and Y, but I want the color of each of the
|> points to correspond to information contained in another
|> vector Z (same length as X and Y, but scaled in value to
|> match the size of the color table of choice).
PLOTS will accept and use a vector valued color.
--
____________________________________________________________ _______________
Paul Ricchiazzi
Institute for Computational Earth System Science (ICESS)
University of California, Santa Barbara
email: paul@icess.ucsb.edu
____________________________________________________________ _______________
|
|
|