# HG changeset patch # User Daniel J Sebald # Date 1502900298 18000 # Node ID fe780a4b89c1c184500ac29fd604703850d3dc12 # Parent 4be7a254f7521e308c9f7dc1ac09c953a6300e47 Supply missing axis labels for gnuplot toolkit (bug #51759). * __gnuplot_draw_axes__.m (do_tics_1): Assign empty string to 'labels' if 'labels' is empty (i.e., size 0x0). Use repmat() to repeat labels when the number of labels is shorter than number of tics. Remove the conditional test that resets index k to the start of labels when there are too few. diff -r 4be7a254f752 -r fe780a4b89c1 scripts/plot/util/private/__gnuplot_draw_axes__.m --- a/scripts/plot/util/private/__gnuplot_draw_axes__.m Wed Aug 23 22:18:00 2017 +0200 +++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m Wed Aug 16 11:18:18 2017 -0500 @@ -2330,7 +2330,8 @@ if (strcmp (labelmode, "manual")) k = 1; ntics = numel (tics); - nlabels = numel (labels); + labels(end+1:1) = {""}; + labels = repmat (labels(:), ceil (ntics/numel (labels)), 1); fprintf (plot_stream, "set %stics add %s %s %s %s (", ax, tickdir, ticklength, axispos, mirror); labels = strrep (labels, "%", "%%"); @@ -2339,9 +2340,6 @@ if (i < ntics) fputs (plot_stream, ", "); endif - if (k > nlabels) - k = 1; - endif endfor fprintf (plot_stream, ") %s %s;\n", colorspec, fontspec); endif