Skip to content

Commit d272aa1

Browse files
committed
Add test for collections setter and getter
1 parent 03fb397 commit d272aa1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/matplotlib/tests/test_collections.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,3 +1336,24 @@ def test_striped_lines(fig_test, fig_ref, gapcolor):
13361336
for x, gcol, ls in zip(x, itertools.cycle(gapcolor),
13371337
itertools.cycle(linestyles)):
13381338
ax_ref.axvline(x, 0, 1, linestyle=ls, gapcolor=gcol, alpha=0.5)
1339+
1340+
1341+
@check_figures_equal(extensions=['png', 'pdf', 'svg', 'eps'])
1342+
def test_hatch_linewidth(fig_test, fig_ref):
1343+
ax_test = fig_test.add_subplot()
1344+
ax_ref = fig_ref.add_subplot()
1345+
1346+
lw = 2.0
1347+
1348+
ref = mcollections.CircleCollection(sizes=[1, 2, 3, 4, 5], hatch='x')
1349+
ref.set_linewidth(2)
1350+
1351+
with mpl.rc_context({'hatch.linewidth': lw}):
1352+
test = mcollections.CircleCollection(sizes=[1, 2, 3, 4, 5], hatch='x')
1353+
test.set_linewidth(2)
1354+
1355+
# Add the collection to the axes
1356+
ax_ref.add_collection(ref)
1357+
ax_test.add_collection(test)
1358+
1359+
assert ((test.get_linewidth() == lw) and (ref.get_linewidth() == lw))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy