help-octave
[Top][All Lists]
Advanced

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

Re: Setting linestyle/color when plotting matrix.


From: Ben Abbott
Subject: Re: Setting linestyle/color when plotting matrix.
Date: Thu, 05 Jul 2012 19:34:13 -0400

On Jul 5, 2012, at 7:16 PM, Robert T. Short wrote:

> Suppose I am plotting a matrix, e.g.
> 
> > t = (0:0.01:1).';
> > y = [sin(2*pi*t), sin(3*pi*t), sin(4*pi*t)];
> > plot(t,y)
> 
> I can set color and linestyle using
> > plot(t,y,['-r';'--k';':c']);
> 
> However if I try
> 
> > plot(t,y,'color', ['r';'k';'c'], 'linestyle',['-';'--';':']);
> error: invalid value = -
> error: set: invalid value for radio property "linestyle" (value = - )
> 
> similarly
> > plot(t,y,'color', ['r';'k';'c']);
> 
> works but all of the lines are red.
> 
> How do I set line properties for matrices using color, linestyle, etc.?
> 
> I am using octave 3.6.2 on a debian system.
> 
> Bob

To handle multiple line objects use the returned objects handles.

        h = plot (x1, y1, x2, y2, x3, y3);

And then use the set() function to set the color, marker, linestyle, etc.

Ben


reply via email to

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