Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25b7ebd

Browse files
committed
Add test for add_collection
1 parent 3f0afd5 commit 25b7ebd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ def test_formatter_ticker():
5454
ax.set_xlabel( "x-label 005" )
5555
ax.autoscale_view()
5656

57+
def test_add_collection():
58+
fig = matplotlib.figure.Figure()
59+
fig2 = matplotlib.figure.Figure()
60+
ax = fig.add_subplot(111)
61+
ax2 = fig2.add_subplot(111)
62+
coll = ax2.scatter([0, 1], [0, 1])
63+
ax.add_collection(coll)
64+
bounds = ax.dataLim.bounds
65+
coll = ax2.scatter([], [])
66+
ax.add_collection(coll)
67+
assert ax.dataLim.bounds == bounds
68+
5769
@image_comparison(baseline_images=["formatter_large_small"])
5870
def test_formatter_large_small():
5971
# github issue #617, pull #619

0 commit comments

Comments
 (0)