changeset 24406:cb6a61636a23

Make gnuplot toolkit image color mapping consistent with OpenGL toolkits (bug #52624). * __gnuplot_draw_axes__.m (mapcdata): Do not treat logical image as unique from "scaled" or "direct" mapping mode. In "direct" mapping mode, add 1 to cdata which is logical class.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Tue, 12 Dec 2017 18:38:50 -0600
parents 77b6e0cd22b1
children ca0ebd1d0da1
files scripts/plot/util/private/__gnuplot_draw_axes__.m
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m	Tue Dec 12 17:51:06 2017 -0800
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m	Tue Dec 12 18:38:50 2017 -0600
@@ -2848,9 +2848,7 @@
       cdata(:) = 255;
     endif
   else
-    if (islogical (cdata))
-      cdata += 1;
-    elseif (strcmp (mode, "scaled"))
+    if (strcmp (mode, "scaled"))
       clim = double (clim);
       cdata = double (cdata);
       clim_rng = clim(2) - clim(1);
@@ -2860,7 +2858,7 @@
         cdata(:) = cmap_sz;
       endif
     else
-      if (isinteger (cdata))
+      if (islogical (cdata) || isinteger (cdata))
         cdata += 1;
       else
         cdata = fix (cdata);