changeset 30186:a150f1945ad0

Interpret single RGB patch color in the same manner as Matlab (bug #61127). * __patch__.m: Add special check for color specification being a 1x3 row vector and do not transpose it.
author Rik <rik@octave.org>
date Thu, 16 Sep 2021 09:19:58 -0700
parents 603a83d18107
children f655202744be
files scripts/plot/draw/private/__patch__.m
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__patch__.m	Wed Sep 15 16:22:27 2021 -0700
+++ b/scripts/plot/draw/private/__patch__.m	Thu Sep 16 09:19:58 2021 -0700
@@ -81,8 +81,12 @@
         y = y(:);
         z = z(:);
         if (isnumeric (c))
-          if (isvector (c) && numel (c) == numel (x))
-            c = c(:);
+          if (isvector (c))
+            if (isequal (size (c), [1, 3]))
+              ## Do nothing, this is a single RGB color specification
+            elseif (numel (c) == numel (x))
+              c = c(:);
+            endif
           elseif (rows (c) != numel (x) && columns (c) == numel (x))
             c = c.';
           endif