exporting patch:
# HG changeset patch
# User Daniel J Sebald <daniel.sebald@ieee.org>
# Date 1464186937 18000
#      Wed May 25 09:35:37 2016 -0500
# Node ID 943dcb23a7a1eb9661a6b7fc42a674924590bc90
# Parent  45871845a93cfb6afe00f9c8eb063b2a012cf0e1
Remove axes drawing for gnuplot graphics toolkit when visible property is 'off'

* __gnuplot_draw_axes__.m (__gnuplot_draw_axes__): 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().

diff --git a/scripts/plot/util/private/__gnuplot_draw_axes__.m b/scripts/plot/util/private/__gnuplot_draw_axes__.m
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m
@@ -1415,60 +1415,59 @@ function __gnuplot_draw_axes__ (h, plot_
     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)
