[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45356] Wrong tick labels when limits are set
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #45356] Wrong tick labels when limits are set manually |
Date: |
Fri, 19 Jun 2015 17:00:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:32.0) Gecko/20100101 Firefox/32.0 |
Update of bug #45356 (project octave):
Status: None => Patch Submitted
_______________________________________________________
Follow-up Comment #2:
This is a little strange. It's not tragic, but could probably be improved.
The issue is that the routine that tries to find a reasonable spacing of
ticklabels will often produce an extra ticklabel at the far left and far right
of the range. These values may be outside the current xlim, which isn't a
problem for display because any labels outside the current limits are not
displayed. Here is an example that is pretty clear.
plot (1:10);
xlim ([4.75, 8.5]);
get (gca, "xtick")
ans =
4 5 6 7 8 9
The routine for finding ticks likes to divide the range into 5 divisions,
although it will compromise and use 4 or 6 as necessary. In this case it
produced five divisions: 4-5, 5-6, 6-7, 7-8, 8-9. But the endpoints of the
divisions 4 and 9 are not visible. The code to change is
calc_ticks_and_lims() in graphics.cc. See the attached patch. It appears to
work, but I only used the example from this bug report for testing. It would
need a bit more verification before commititng.
(file #34266)
_______________________________________________________
Additional Item Attachment:
File name: tick.cset Size:0 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45356>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/