()
| 487 | |
| 488 | |
| 489 | def test_colorbar_autotickslog(): |
| 490 | # Test new autotick modes... |
| 491 | with rc_context({'_internal.classic_mode': False}): |
| 492 | fig, ax = plt.subplots(2, 1) |
| 493 | x = np.arange(-3.0, 4.001) |
| 494 | y = np.arange(-4.0, 3.001) |
| 495 | X, Y = np.meshgrid(x, y) |
| 496 | Z = X * Y |
| 497 | Z = Z[:-1, :-1] |
| 498 | pcm = ax[0].pcolormesh(X, Y, 10**Z, norm=LogNorm()) |
| 499 | cbar = fig.colorbar(pcm, ax=ax[0], extend='both', |
| 500 | orientation='vertical') |
| 501 | |
| 502 | pcm = ax[1].pcolormesh(X, Y, 10**Z, norm=LogNorm()) |
| 503 | cbar2 = fig.colorbar(pcm, ax=ax[1], extend='both', |
| 504 | orientation='vertical', shrink=0.4) |
| 505 | |
| 506 | fig.draw_without_rendering() |
| 507 | # note only -12 to +12 are visible |
| 508 | np.testing.assert_equal(np.log10(cbar.ax.yaxis.get_ticklocs()), |
| 509 | [-18, -12, -6, 0, +6, +12, +18]) |
| 510 | np.testing.assert_equal(np.log10(cbar2.ax.yaxis.get_ticklocs()), |
| 511 | [-36, -12, 12, +36]) |
| 512 | |
| 513 | |
| 514 | def test_colorbar_get_ticks(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…