[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #62883] plot() function handles property/value
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #62883] plot() function handles property/value pairs differently from Matlab |
Date: |
Wed, 10 Aug 2022 17:45:40 -0400 (EDT) |
Update of bug #62883 (project octave):
Item Group: None => Matlab Compatibility
Status: None => Confirmed
Release: 7.1.0 => dev
Summary: 'parent' property not working as expected => plot()
function handles property/value pairs differently from Matlab
_______________________________________________________
Follow-up Comment #1:
This is not a problem with the "parent" property, but rather a general
difference between how Octave and Matlab handle property/value pairs. In
Octave, prop/val pairs apply to the nearest XY data and you can have different
prop/val pairs for different sets of XY data. In Matlab, you can specify a
LineSpec per XY data set, but ALL XY data share the prop/val pairs.
Example
x = linspace(-2*pi,2*pi);
y1 = sin(x);
y2 = cos(x);
plot (x,y1,x,y2, 'color', 'm')
The result is that the first line uses the default color from the ColorOrder
property while the second line has the default overridden to magenta.
File:octave.png
In Octave, you can apply properties individually so this works
plot (x,y1, 'color', 'r', x,y2, 'color', 'm')
File:octave2.png
If you try this syntax with Matlab it will generate an error because it only
allows one set of property/value pairs and it must occur after all XY data has
been specified.
(file #53557, file #53558)
_______________________________________________________
Additional Item Attachment:
File name: octave.png Size:31 KB
<https://file.savannah.gnu.org/file/octave.png?file_id=53557>
File name: octave2.png Size:27 KB
<https://file.savannah.gnu.org/file/octave2.png?file_id=53558>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62883>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/