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 ba075b1

Browse filesBrowse files
committed
TST: test that blended transforms autolim
1 parent a7f4397 commit ba075b1
Copy full SHA for ba075b1

File tree

Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-0
lines changed

‎lib/matplotlib/tests/test_collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_collections.py
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,3 +616,17 @@ def test_collection_set_verts_array():
616616
for ap, lp in zip(col_arr._paths, col_list._paths):
617617
assert np.array_equal(ap._vertices, lp._vertices)
618618
assert np.array_equal(ap._codes, lp._codes)
619+
620+
621+
def test_blended_collection_autolim():
622+
a = [1, 2, 4]
623+
height = .2
624+
625+
xy_pairs = np.column_stack([np.repeat(a, 2), np.tile([0, height], len(a))])
626+
line_segs = xy_pairs.reshape([len(a), 2, 2])
627+
628+
f, ax = plt.subplots()
629+
trans = mtransforms.blended_transform_factory(ax.transData, ax.transAxes)
630+
ax.add_collection(LineCollection(line_segs, transform=trans))
631+
ax.autoscale_view(scalex=True, scaley=False)
632+
np.testing.assert_allclose(ax.get_xlim(), [1., 4.])

0 commit comments

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