8000 TST: add contour tests for horiz and vertical · matplotlib/matplotlib@5525bbe · GitHub
[go: up one dir, main page]

Skip to content

Commit 5525bbe

Browse files
committed
TST: add contour tests for horiz and vertical
1 parent 34636bf commit 5525bbe

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Loading

lib/matplotlib/tests/test_colorbar.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,17 @@ def test_colorbar_positioning(use_gridspec):
185185
anchor=(0.8, 0.5), shrink=0.6, use_gridspec=use_gridspec)
186186

187187

188+
@image_comparison(['contour_colorbar.png'], remove_text=True)
189+
def test_contour_colorbar():
190+
fig, ax = plt.subplots(figsize=(4, 2))
191+
data = np.arange(1200).reshape(30, 40) - 500
192+
levels = np.array([0, 200, 400, 600, 800, 1000, 1200]) - 500
193+
194+
CS = ax.contour(data, levels=levels, extend='both')
195+
fig.colorbar(CS, orientation='horizontal', extend='both')
196+
fig.colorbar(CS, orientation='vertical')
197+
198+
188199
@image_comparison(['cbar_with_subplots_adjust.png'], remove_text=True,
189200
savefig_kwarg={'dpi': 40})
190201
def test_gridspec_make_colorbar():

0 commit comments

Comments
 (0)
0