[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: |
Fri, 06 Jul 2012 11:53:04 -0400 |
*** Moved to the maintainers list ***
On Jul 5, 2012, at 7:34 PM, Ben Abbott wrote:
> 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
Robert,
Perhaps something similar to the behavior you had expected can be added to
Octave.
plot (t, y, "color", {"r", "k", "c"}, "linestyle", {"-", "--"; ":"});
I've attached a proposed patch. Does this look like a good idea?
Ben
parseprops.diff
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Setting linestyle/color when plotting matrix.,
Ben Abbott <=