changeset 21775:6cf6bc451eeb

Don't draw axes object when visible property is 'off' for gnuplot (bug #47974) * __gnuplot_draw_axes__.m: Move the custom axes border drawing to inside the case statement for axis_obj.visible not 'off'. Delete line of code that sets border line width, which is handled in do_border_2d().
author Daniel J Sebald <daniel.sebald@ieee.org>
date Wed, 25 May 2016 09:35:37 -0500
parents ca9e09417e1f
children d6826b38b29c
files scripts/plot/util/private/__gnuplot_draw_axes__.m
diffstat 1 files changed, 50 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m	Wed May 25 09:16:04 2016 -0700
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m	Wed May 25 09:35:37 2016 -0500
@@ -1415,60 +1415,59 @@
     endif
   endif
 
-  axis_idx = data_idx;
-  if (strcmpi (axis_obj.box, "on"))
-    if (nd == 3)
-      fputs (plot_stream, "set border 4095;\n");
-    else
-      axis_idx = do_border_2d (axis_obj, plot_stream, axis_idx);
-    endif
-  else
-    if (nd == 3)
-      fputs (plot_stream, "set border 895;\n");
-    elseif (! isempty (axis_obj.ytick))
-      if (strcmpi (axis_obj.yaxislocation, "right"))
-        fprintf (plot_stream, "unset ytics; set y2tics %s nomirror\n",
-                 axis_obj.tickdir);
-        if (strcmpi (axis_obj.xaxislocation, "top"))
-          maybe_do_x2tick_mirror (plot_stream, axis_obj)
-        elseif (strcmpi (axis_obj.xaxislocation, "bottom"))
-          maybe_do_xtick_mirror (plot_stream, axis_obj)
-        else # xaxislocation == zero
-          fprintf (plot_stream, "unset x2tics; set xtics %s nomirror\n",
-                   axis_obj.tickdir);
-        endif
-      elseif (strcmpi (axis_obj.yaxislocation, "left"))
-        fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n",
-                 axis_obj.tickdir);
-        if (strcmpi (axis_obj.xaxislocation, "top"))
-          maybe_do_x2tick_mirror (plot_stream, axis_obj)
-        elseif (strcmpi (axis_obj.xaxislocation, "bottom"))
-          maybe_do_xtick_mirror (plot_stream, axis_obj)
-        else # xaxislocation == zero
-          maybe_do_xtick_mirror (plot_stream, axis_obj)
-        endif
-      else # yaxislocation == zero
-        fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n",
-                 axis_obj.tickdir);
-        if (strcmpi (axis_obj.xaxislocation, "top"))
-          maybe_do_x2tick_mirror (plot_stream, axis_obj)
-        elseif (strcmpi (axis_obj.xaxislocation, "bottom"))
-          maybe_do_xtick_mirror (plot_stream, axis_obj)
-        else # xaxislocation == zero
-          maybe_do_xtick_mirror (plot_stream, axis_obj)
-          fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n",
-                   axis_obj.tickdir);
-          fputs (plot_stream, "unset border;\n");
-        endif
-      endif
-      axis_idx = do_border_2d (axis_obj, plot_stream, axis_idx);
-    endif
-  endif
-
   if (strcmpi (axis_obj.visible, "off"))
     fputs (plot_stream, "unset border; unset tics\n");
   else
-    fprintf (plot_stream, "set border lw %f;\n", axis_obj.linewidth);
+    fputs (plot_stream, "unset border\n");
+    axis_idx = data_idx;
+    if (strcmpi (axis_obj.box, "on"))
+      if (nd == 3)
+        fputs (plot_stream, "set border 4095;\n");
+      else
+        axis_idx = do_border_2d (axis_obj, plot_stream, axis_idx);
+      endif
+    else
+      if (nd == 3)
+        fputs (plot_stream, "set border 895;\n");
+      elseif (! isempty (axis_obj.ytick))
+        if (strcmpi (axis_obj.yaxislocation, "right"))
+          fprintf (plot_stream, "unset ytics; set y2tics %s nomirror\n",
+                   axis_obj.tickdir);
+          if (strcmpi (axis_obj.xaxislocation, "top"))
+            maybe_do_x2tick_mirror (plot_stream, axis_obj)
+          elseif (strcmpi (axis_obj.xaxislocation, "bottom"))
+            maybe_do_xtick_mirror (plot_stream, axis_obj)
+          else # xaxislocation == zero
+            fprintf (plot_stream, "unset x2tics; set xtics %s nomirror\n",
+                     axis_obj.tickdir);
+          endif
+        elseif (strcmpi (axis_obj.yaxislocation, "left"))
+          fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n",
+                   axis_obj.tickdir);
+          if (strcmpi (axis_obj.xaxislocation, "top"))
+            maybe_do_x2tick_mirror (plot_stream, axis_obj)
+          elseif (strcmpi (axis_obj.xaxislocation, "bottom"))
+            maybe_do_xtick_mirror (plot_stream, axis_obj)
+          else # xaxislocation == zero
+            maybe_do_xtick_mirror (plot_stream, axis_obj)
+          endif
+        else # yaxislocation == zero
+          fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n",
+                   axis_obj.tickdir);
+          if (strcmpi (axis_obj.xaxislocation, "top"))
+            maybe_do_x2tick_mirror (plot_stream, axis_obj)
+          elseif (strcmpi (axis_obj.xaxislocation, "bottom"))
+            maybe_do_xtick_mirror (plot_stream, axis_obj)
+          else # xaxislocation == zero
+            maybe_do_xtick_mirror (plot_stream, axis_obj)
+            fprintf (plot_stream, "unset y2tics; set ytics %s nomirror\n",
+                     axis_obj.tickdir);
+            fputs (plot_stream, "unset border;\n");
+          endif
+        endif
+        axis_idx = do_border_2d (axis_obj, plot_stream, axis_idx);
+      endif
+    endif
   endif
 
   if (! isempty (hlgnd) && ! isempty (hlgnd.children)