Skip to content

Commit fbfa18e

Browse files
committed
TST: make sure edge minor ticks are drawn
1 parent ee1fb54 commit fbfa18e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def __call__(self):
267267
vmin = self._colorbar.norm.vmin
268268
vmax = self._colorbar.norm.vmax
269269
ticks = ticker.AutoMinorLocator.__call__(self)
270-
rtol = (vmax - vmin) * 1e-10
270+
rtol = (vmax - vmin) * 1e-10
271271
return ticks[(ticks >= vmin - rtol) & (ticks <= vmax + rtol)]
272272

273273

lib/matplotlib/tests/test_colorbar.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,15 @@ def test_colorbar_minorticks_on_off():
294294
np.testing.assert_almost_equal(cbar.ax.yaxis.get_minorticklocs(),
295295
np.array([]))
296296

297+
im.set_clim(vmin=-1.2, vmax=1.2)
298+
cbar.minorticks_on()
299+
correct_minorticklocs = np.array([-1.2, -1.1, -0.9, -0.8, -0.7, -0.6,
300+
-0.4, -0.3, -0.2, -0.1, 0.1, 0.2,
301+
0.3, 0.4, 0.6, 0.7, 0.8, 0.9,
302+
1.1, 1.2])
303+
np.testing.assert_almost_equal(cbar.ax.yaxis.get_minorticklocs(),
304+
correct_minorticklocs)
305+
297306

298307
def test_colorbar_autoticks():
299308
# Test new autotick modes. Needs to be classic because

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy