Mercurial > octave
changeset 23934:fe780a4b89c1
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.
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Wed, 16 Aug 2017 11:18:18 -0500 |
parents | 4be7a254f752 |
children | 2ae8efbafb58 |
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 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