8000 TST: add test for uneven contour colorbar · matplotlib/matplotlib@d12c113 · GitHub
[go: up one dir, main page]

Skip to content

Commit d12c113

Browse files
committed
TST: add test for uneven contour colorbar
1 parent 7b3ea96 commit d12c113

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Loading

lib/matplotlib/tests/test_contour.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,3 +423,16 @@ def test_contour_addlines():
423423
cb = fig.colorbar(pcm)
424424
cb.add_lines(cont)
425425
assert_array_almost_equal(cb.ax.get_ylim(), [114.3091, 9972.30735], 3)
426+
427+
428+
@image_comparison(baseline_images=['contour_uneven'],
429+
extensions=['png'], remove_text=True, style='mpl20')
430+
def test_contour_uneven():
431+
z = np.arange(24).reshape(4, 6)
432+
fig, axs = plt.subplots(1, 2)
433+
ax = axs[0]
434+
cs = ax.contourf(z, levels=[2, 4, 6, 10, 20])
435+
fig.colorbar(cs, ax=ax, spacing='proportional')
436+
ax = axs[1]
437+
cs = ax.contourf(z, levels=[2, 4, 6, 10, 20])
438+
fig.colorbar(cs, ax=ax, spacing='uniform')

0 commit comments

Comments
 (0)
0