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

interpolated line coloring?

1,284 views
Skip to first unread message

Uwe Sydow

unread,
Jan 12, 1999, 3:00:00 AM1/12/99
to
Hello,

is there a way to use interpolated coloring for 2D-line plotting?
For instance
plot(linedata,'r')
plots a red line.
What I'm looking for is something like
plot(linedata,'from dark red to blue')?
to get the line colored like a rainbow?

Thanks for possible suggestions

Uwe Sydow (sy...@uni-bremen.de)

Jonathan Zarge

unread,
Jan 13, 1999, 3:00:00 AM1/13/99
to sy...@uni-bremen.de
Hi,

I rember answering a similar question a while ago... You could try using
a patch object:

x = [1 2 3 4 5 6];
y = [2 1 4 3 8 4];
d = [10 12 -3 44 35 0];

p = patch([x nan],[y nan], [d nan], 'EdgeColor', 'interp');
% nans added so face will not close

Hope this helps,

Jonathan Zarge
j...@mathworks.com
The MathWorks, Inc.
24 Prime Park Way
Natick, MA 01760
http://www.mathworks.com

0 new messages