()
| 462 | |
| 463 | |
| 464 | def test_colorbar_autoticks(): |
| 465 | # Test new autotick modes. Needs to be classic because |
| 466 | # non-classic doesn't go this route. |
| 467 | with rc_context({'_internal.classic_mode': False}): |
| 468 | fig, ax = plt.subplots(2, 1) |
| 469 | x = np.arange(-3.0, 4.001) |
| 470 | y = np.arange(-4.0, 3.001) |
| 471 | X, Y = np.meshgrid(x, y) |
| 472 | Z = X * Y |
| 473 | Z = Z[:-1, :-1] |
| 474 | pcm = ax[0].pcolormesh(X, Y, Z) |
| 475 | cbar = fig.colorbar(pcm, ax=ax[0], extend='both', |
| 476 | orientation='vertical') |
| 477 | |
| 478 | pcm = ax[1].pcolormesh(X, Y, Z) |
| 479 | cbar2 = fig.colorbar(pcm, ax=ax[1], extend='both', |
| 480 | orientation='vertical', shrink=0.4) |
| 481 | # note only -10 to 10 are visible, |
| 482 | np.testing.assert_almost_equal(cbar.ax.yaxis.get_ticklocs(), |
| 483 | np.arange(-15, 16, 5)) |
| 484 | # note only -10 to 10 are visible |
| 485 | np.testing.assert_almost_equal(cbar2.ax.yaxis.get_ticklocs(), |
| 486 | np.arange(-20, 21, 10)) |
| 487 | |
| 488 | |
| 489 | def test_colorbar_autotickslog(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…