[Top][All Lists]

[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.


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.


In Octave, you can apply properties individually so this works

plot (x,y1, 'color', 'r', x,y2, 'color', 'm')


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

File name: octave2.png                    Size:27 KB


Reply to this item at:


Message sent via Savannah

reply via email to

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