changeset 22579:6e492d3d2e1e stable

Do not transform RGB color data for patches in gnuplot toolkit (bug #47974). * __gnuplot_draw_axes__.m: Move the mapping of color data in one or two levels for the patch 'facecolor' and 'edgecolor' property processing.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Sat, 01 Oct 2016 21:06:42 -0500
parents 956f5c71dc3c
children 3b4dd7f71a01
files scripts/plot/util/private/__gnuplot_draw_axes__.m
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m	Sat Oct 01 18:45:39 2016 -0700
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m	Sat Oct 01 21:06:42 2016 -0500
@@ -775,14 +775,16 @@
                     ccol = cdat;
                   endif
                   if (strcmp (obj.facecolor, "flat"))
-                    ccdat = mapcdata (ccol, obj.cdatamapping, clim, cmap_sz);
                     if (isequal (size (ccol), [1, 3]))
                       ## RGB Triplet
                       color = ccol;
-                    elseif (nd == 3 && numel (xcol) == 3)
-                      color = cmap(ccdat(1), :);
                     else
-                      color = cmap(ccdat, :);
+                      ccdat = mapcdata (ccol, obj.cdatamapping, clim, cmap_sz);
+                      if (nd == 3 && numel (xcol) == 3)
+                        color = cmap(ccdat(1), :);
+                      else
+                        color = cmap(ccdat, :);
+                      endif
                     endif
                   elseif (strcmp (obj.facecolor, "interp"))
                     if (nd == 3 && numel (xcol) == 3)
@@ -894,10 +896,12 @@
                   ccol = cdat;
                 endif
                 if (strcmp (ec, "flat"))
-                  ccol = mapcdata (ccol, obj.cdatamapping, clim, cmap_sz);
                   if (isequal (size (ccol), [1, 3]))
                     color = ccol;
                   else
+                    if (columns (ccol) != 3)
+                      ccol = mapcdata (ccol, obj.cdatamapping, clim, cmap_sz);
+                    endif
                     if (isscalar (ccol))
                       ccol = repmat (ccol, numel (xcol), 1);
                     endif