changeset 23947:d837f7f6e4aa

Don't label all values on bar plot when there are more than 15 bars (bug #51773). * __bar__.m: Check that the number of bar elements to label is <= 15 before labeling them; Otherwise, use default selected tick positions.
author Rik <rik@octave.org>
date Fri, 25 Aug 2017 17:10:27 -0700
parents c7b801f36be4
children 9c97909a6c94
files scripts/plot/draw/private/__bar__.m
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__bar__.m	Fri Aug 25 16:26:59 2017 -0700
+++ b/scripts/plot/draw/private/__bar__.m	Fri Aug 25 17:10:27 2017 -0700
@@ -200,7 +200,9 @@
                    have_line_spec, bv, newargs{:});
 
       if (! ishold ())
-        if (all (x(:,1) == fix (x(:,1))))
+        if (numel (x(:,1)) <= 15 && all (x(:,1) == fix (x(:,1))))
+          ## Set manual ticks, rather than relying on autoselection,
+          ## when ticks are a small number of integers.
           if (vertical)
             set (hax, "xtick", x(:,1));
           else