()
| 371 | |
| 372 | @image_comparison(["scatter.eps"], style='_classic_test') |
| 373 | def 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"}, |
nothing calls this directly
no test coverage detected
searching dependent graphs…