Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit de53d5c

Browse filesBrowse files
committed
TST: add smoke test for logscaled color bars
1 parent 5601342 commit de53d5c
Copy full SHA for de53d5c

File tree

Expand file treeCollapse file tree

1 file changed

+23
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+23
-1
lines changed
Open diff view settings
Collapse file

‎lib/mpl_toolkits/tests/test_axes_grid1.py‎

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/tests/test_axes_grid1.py
+23-1Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
from matplotlib.externals import six
55

66
import matplotlib.pyplot as plt
7-
from matplotlib.testing.decorators import image_comparison
7+
from matplotlib.testing.decorators import image_comparison, cleanup
8+
89
from mpl_toolkits.axes_grid1 import make_axes_locatable
10+
from mpl_toolkits.axes_grid1 import AxesGrid
11+
12+
from matplotlib.colors import LogNorm
13+
914
import numpy as np
1015

1116

@@ -50,6 +55,23 @@ def test_divider_append_axes():
5055
axHistleft.yaxis.set_ticklabels(())
5156
axHistright.yaxis.set_ticklabels(())
5257

58+
59+
@cleanup
60+
def test_axesgrid_colorbar_log_smoketest():
61+
fig = plt.figure()
62+
grid = AxesGrid(fig, 111, # modified to be only subplot
63+
nrows_ncols=(1, 1),
64+
label_mode="L",
65+
cbar_location="top",
66+
cbar_mode="single",
67+
)
68+
69+
Z = 10000 * np.random.rand(10, 10)
70+
im = grid[0].imshow(Z, interpolation="nearest", norm=LogNorm())
71+
72+
grid.cbar_axes[0].colorbar(im)
73+
74+
5375
if __name__ == '__main__':
5476
import nose
5577
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.