MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_path_collection

Function test_path_collection

lib/matplotlib/tests/test_backend_ps.py:373–391  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

371
372@image_comparison(["scatter.eps"], style='_classic_test')
373def test_path_collection():
374 rng = np.random.default_rng(19680801)
375 xvals = rng.uniform(0, 1, 10)
376 yvals = rng.uniform(0, 1, 10)
377 sizes = rng.uniform(30, 100, 10)
378 fig, ax = plt.subplots()
379 ax.scatter(xvals, yvals, sizes, edgecolor=[0.9, 0.2, 0.1], marker='<')
380 ax.set_axis_off()
381 paths = [path.Path.unit_regular_polygon(i) for i in range(3, 7)]
382 offsets = rng.uniform(0, 200, 20).reshape(10, 2)
383 sizes = [0.02, 0.04]
384 pc = mcollections.PathCollection(paths, sizes, zorder=-1,
385 facecolors='yellow', offsets=offsets)
386 # Note: autolim=False is used to keep the view limits as is for now,
387 # given the updated behavior of autolim=True to also update the view
388 # limits. It may be reasonable to test the limits handling in the future
389 # as well. This will require regenerating the reference image.
390 ax.add_collection(pc, autolim=False)
391 ax.set_xlim(0, 1)
392
393
394@image_comparison(["colorbar_shift.eps"], savefig_kwarg={"bbox_inches": "tight"},

Callers

nothing calls this directly

Calls 6

unit_regular_polygonMethod · 0.80
add_collectionMethod · 0.80
subplotsMethod · 0.45
scatterMethod · 0.45
set_axis_offMethod · 0.45
set_xlimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…