Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5adc3f7 commit b11b32cCopy full SHA for b11b32c
1 file changed
lib/matplotlib/ticker.py
@@ -1767,10 +1767,11 @@ def __call__(self):
1767
return self.tick_values(dmin, dmax)
1768
1769
def tick_values(self, vmin, vmax):
1770
- ticks = np.arange(vmin + self.offset, vmax + 1, self._base)
1771
- # Filter out ticks that exceed vmax to avoid off-by-one errors
1772
- ticks = ticks[ticks <= vmax]
1773
- return self.raise_if_exceeds(ticks)
+ # We want tick values in the closed interval [vmin, vmax].
+ # Since np.arange(start, stop) returns values in the semi-open interval
+ # [start, stop), we add a minimal offset so that stop = vmax + eps
+ tick_values = np.arange(vmin + self.offset, vmax + 1e-12, self._base)
1774
+ return self.raise_if_exceeds(tick_values)
1775
1776
1777
class FixedLocator(Locator):
0 commit comments