changeset 24112:2cc851e8e03f

Change gnuplot-toolkit fprintf() sequence to handle single axis tic (bug #52140). * __gnuplot_draw_axes__ (do_tics_1): Condition the tic format string on more than one tic so that valid syntax is produced for 0, 1 or more tics.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Thu, 28 Sep 2017 15:59:08 -0500
parents 392afc740749
children e15ad9af158f
files scripts/plot/util/private/__gnuplot_draw_axes__.m
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m	Thu Sep 28 13:22:30 2017 +0200
+++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m	Thu Sep 28 15:59:08 2017 -0500
@@ -2321,8 +2321,11 @@
     endif
     fprintf (plot_stream, "set %stics %s %s %s %s (", ax, tickdir,
              ticklength, axispos, mirror);
-    fprintf (plot_stream, " %.15g,", tics(1:end-1));
-    fprintf (plot_stream, " %.15g) %s;\n", tics(end), fontspec);
+    fprintf (plot_stream, "%.15g", tics(1));
+    if (numel (tics) > 1)
+      fprintf (plot_stream, ",%.15g", tics(2:end));
+    endif
+    fprintf (plot_stream, ") %s;\n", fontspec);
   else
     fprintf (plot_stream, "set %stics %s %s %s %s %s %s;\n", ax,
              tickdir, ticklength, axispos, mirror, colorspec, fontspec);