Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: plot2d with different colours per graph

57 views
Skip to first unread message
Message has been deleted

fake...@invalid.domain

unread,
Jun 26, 2009, 5:25:31 PM6/26/09
to
In article <7qbeh6x...@news.c0t0d0s0.de>,
Michael Welle <mwe0...@gmx.net> wrote:
>Hi,
>
>I want to plot2d a vector with datapoints. Now I want the colour of the
>graph depending on the values of the datapoints. Imaging a sine
>function, now plot all positive values of sin(x) in red colour and all
>negative values in blue colour. So can I somehow provide a function that
>delivers the colour of a given point? Or must I plot the graph
>piecewise?

I had several ideas on how to this and they all failed.

1. If one reads polyline_properties there is an interp_color_mode
and an interp_color_vector which might do what you want. However
the documentation is beyond my understanding:

interp_color_vector: This field contains the vector of color
indices used to fill in the polyline when the interp_color_mode
property is set to "on". It defines the intervals of colormap
indices used to fill each segment. For instance, the first
segment will be filled by every colors whose index is between
the first two elements of the vecor. It is only applicable if
the polyline is defined by 3 or 4 points. Therefore, the size
of the vector must match this dimension.

interp_color_mode: This field determines if we are using the
interpolated shading mode to fill the polyline : its value can
be "on" or "off". Note that an interp_color_vector must be
defined before switching to "on" value (see above). mark_mode:
This field contains the default mark_mode property value for
the polyline. Its value should be "on" (marks drawn) or "off"
(no marks drawn).

I found no examples on the use of the interp features; A web search
found nothing but the help page.

2. Use the plot3d color by z-value feature.
a. First I tried doing a curve and viewing the graph so it looked
2D, but the graph was black and not colored
b. Second I tried making the surface constant and almost constant
in one direction. One gets color but also black mesh.
--
Steven Bellenot http://www.math.fsu.edu/~bellenot
Professor and Associate Chair phone: (850) 644-7405
Department of Mathematics office: 223 Love
Florida State University email: bellenot at math.fsu.edu

StéŽphane Mottelet

unread,
Jun 27, 2009, 4:18:08 AM6/27/09
to
Hi.

The possibility of having interpolated color for lines
(scilab can do it for patches) is cruely missing to scilab.
On can simulate this by breaking individual segments and
giving colors to each piece. I am planning to do this in
the plotlib.
I remember the time (scilab 2.3 I guess) I
made a patch for Scilab to be able to render interpolated
facecolor for filled polygons.
When I see the actual rendering in Scilab 5 (the rendering
is still "indexed" althoug there should be possible to use
hardware bilinear interpolated truecolor between the indexed
colors), I have the feeling that my code is still used (hey
Scilab Team is it the case ?).
Doing this for segments should be an easier task, maybe.
Instead of having one color for a segment, we could have
one color for each vertex, meaning that interpolated color
is expected.

S.


fake...@invalid.domain a écrit :

Message has been deleted
0 new messages