help-octave
[Top][All Lists]
Advanced

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

Setting linestyle/color when plotting matrix.


From: Robert T. Short
Subject: Setting linestyle/color when plotting matrix.
Date: Thu, 05 Jul 2012 16:16:27 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

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


reply via email to

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