| 446 | # tolerance is because image changed minutely when tick finding on |
| 447 | # colorbars was cleaned up... |
| 448 | def test_contour_addlines(): |
| 449 | # Remove this line when this test image is regenerated. |
| 450 | plt.rcParams['pcolormesh.snap'] = False |
| 451 | |
| 452 | fig, ax = plt.subplots() |
| 453 | np.random.seed(19680812) |
| 454 | X = np.random.rand(10, 10)*10000 |
| 455 | pcm = ax.pcolormesh(X) |
| 456 | # add 1000 to make colors visible... |
| 457 | cont = ax.contour(X+1000) |
| 458 | cb = fig.colorbar(pcm) |
| 459 | cb.add_lines(cont) |
| 460 | assert_array_almost_equal(cb.ax.get_ylim(), [114.3091, 9972.30735], 3) |
| 461 | |
| 462 | |
| 463 | @image_comparison(['contour_uneven.png'], remove_text=True, style='mpl20') |