Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbfa18e

Browse files
committed
TST: make sure edge minor ticks are drawn
1 parentee1fb54 commitfbfa18e

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
returnticks[(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
deftest_colorbar_autoticks():
299308
# Test new autotick modes. Needs to be classic because

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp