help-octave
[Top][All Lists]
Advanced

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

Re: PLOT - DIfferent colors


From: Dupuis
Subject: Re: PLOT - DIfferent colors
Date: Tue, 2 Feb 2010 23:55:30 -0800 (PST)



Marize Simões wrote:
> 
> Hi user's
> 
> There is a temporal series and I must to colorize it, in some parts of the
> series I need to after the ploted color. Is is possible to accomplish that
> in octave?
> 
> 
Hello Marize,
Very simple. You plot once the whole points in the background color, then
you call 'hold on' to avoid that new plots clear the old ones, and replot
the part of the series you need in a different color. Once done, you call
'hold off' in order to stop accumulating curves on the same graph. At the
replot stage, you need to provide x and y coordinates:

t=(0:127)'/128;
x=sin(2*pi*t);

plot(x, 'b'); %# whole plot
hold on
selected = (t >=.2) & (t < .6); %# this is a boolean vector
plot(t(selected), x(selected), 'r'); %# partial plot
hold off


Regards

Pascal
-- 
View this message in context: 
http://old.nabble.com/PLOT---DIfferent-colors-tp27430656p27432626.html
Sent from the Octave - General mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]