8000 attempting to create a baseline image · matplotlib/matplotlib@633505d · GitHub
[go: up one dir, main page]

Skip to content

Commit 633505d

Browse files
committed
attempting to create a baseline image
couldn't actually run the test suite b/c python iesn't installed as a framework.
1 parent fd9e624 commit 633505d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Loading

lib/matplotlib/tests/test_colors.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,23 @@ def test_premature_scaling(self):
275275
norm.inverse(np.array([0.1, 0.5, 0.9]))
276276

277277

278+
@image_comparison(baseline_images=['test_offset_norm'], extensions=['png'])
279+
def test_offset_norm_img():
280+
x = np.linspace(-2, 7)
281+
y = np.linspace(-1*np.pi, np.pi)
282+
X, Y = np.meshgrid(x, y)
283+
Z = x * np.sin(Y)**2
284+
285+
fig, (ax1, ax2) = plt.subplots(ncols=2)
286+
cmap = plt.cm.coolwarm
287+
norm = mcolors.OffsetNorm(vmin=-2, vcenter=0, vmax=7)
288+
289+
img1 = ax1.imshow(Z, cmap=cmap, norm=None)
290+
cbar1 = fig.colorbar(img1, ax=ax1)
291+
292+
img2 = ax2.imshow(Z, cmap=cmap, norm=norm)
293+
cbar2 = fig.colorbar(img2, ax=ax2)
294+
278295
def test_SymLogNorm():
279296
"""
280297
Test SymLogNorm behavior

0 commit comments

Comments
 (0)
0