octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #65457] Patch: octave and MATLAB interpret amb


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65457] Patch: octave and MATLAB interpret ambiguous patch(x, y, C) case differently
Date: Tue, 12 Mar 2024 17:56:55 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?65457>

                 Summary: Patch: octave and MATLAB interpret ambiguous
patch(x,y,C) case differently
                   Group: GNU Octave
               Submitter: nrjank
               Submitted: Tue 12 Mar 2024 05:56:55 PM EDT
                Category: Plotting
                Severity: 2 - Minor
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 12 Mar 2024 05:56:55 PM EDT By: Nicholas Jankowski <nrjank>
as per the bug #65431 report, when patch is called with the patch(x,y,C) form,
ambiguous forms of C are interpreted differently in Octave vs Matlab.  Octave
interprets all of the cases below as 1-color-per-face over 3 faces, while
MATLAB interprets some as 1 RGB color spec for all three faces and errors on a
few others.


x1 = [1 2 3]';
x2 = [4 5 6]';
y1 = [0 1 0]'; 
y2 = [2 3 2]';


matlab 2023b

hp = patch ([x1,x2,x1], [y1,y2,y2], [0 1 0])
# plots 3 green faces

hp = patch ([x1,x2,x1], [y1,y2,y2], [0 1 0]')
# plots 3 faces each a different color

hp = patch ([x1,x2,x1], [y1,y2,y2], reshape([0 1 0],1,1,3))
# plots 3 green faces


hp = patch ([x1,x2,x1], [y1,y2,y2], [1 2 3])
Error using patch
Invalid RGB triplet. Specify a three-element vector of values between 0 and
1.

hp = patch ([x1,x2,x1], [y1,y2,y2], [1 2 3])
#  plots 3 faces each a different color.

hp = patch ([x1,x2,x1], [y1,y2,y2], reshape([1 2 3],1,1,3))
Error using patch
Invalid RGB triplet. Specify a three-element vector of values between 0 and
1.

hp = patch ([x1,x2,x1], [y1,y2,y2], [.1 .2 .3])
#  plots 3 faces all the same color.

hp = patch ([x1,x2,x1], [y1,y2,y2], [.1 .2 .3]')
#  plots 3 faces each a different color.

hp = patch ([x1,x2,x1], [y1,y2,y2], reshape([.1 .2 .3],1,1,3))
#  plots 3 faces all the same color.


Octave:

hp = patch ([x1,x2,x1], [y1,y2,y2], [0 1 0])
hp = patch ([x1,x2,x1], [y1,y2,y2], [0 1 0]')
hp = patch ([x1,x2,x1], [y1,y2,y2], reshape([1 2 3],0 ,1,0))
## plots three faces, 2 dark one light.

hp = patch ([x1,x2,x1], [y1,y2,y2], [1 2 3])
hp = patch ([x1,x2,x1], [y1,y2,y2], [1 2 3]')
hp = patch ([x1,x2,x1], [y1,y2,y2], reshape([1 2 3],1,1,3))
hp = patch ([x1,x2,x1], [y1,y2,y2], [.1 .2 .3])
hp = patch ([x1,x2,x1], [y1,y2,y2], [.1 .2 .3]')
hp = patch ([x1,x2,x1], [y1,y2,y2], reshape([.1 .2 .3],1,1,3))
# each plots 3 faces each a different color.









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65457>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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