()
| 342 | |
| 343 | @image_comparison(['patch_custom_linestyle'], remove_text=True, style='_classic_test') |
| 344 | def test_patch_custom_linestyle(): |
| 345 | #: A test to check that patches and collections accept custom dash |
| 346 | #: patterns as linestyle and that they display correctly. |
| 347 | star = mpath.Path.unit_regular_star(6) |
| 348 | circle = mpath.Path.unit_circle() |
| 349 | # concatenate the star with an internal cutout of the circle |
| 350 | verts = np.concatenate([circle.vertices, star.vertices[::-1]]) |
| 351 | codes = np.concatenate([circle.codes, star.codes]) |
| 352 | cut_star1 = mpath.Path(verts, codes) |
| 353 | cut_star2 = mpath.Path(verts + 1, codes) |
| 354 | |
| 355 | ax = plt.axes() |
| 356 | col = mcollections.PathCollection( |
| 357 | [cut_star2], |
| 358 | linewidth=5, linestyles=[(0, (5, 7, 10, 7))], |
| 359 | facecolor=(1, 0, 0), edgecolor=(0, 0, 1)) |
| 360 | ax.add_collection(col) |
| 361 | |
| 362 | patch = mpatches.PathPatch( |
| 363 | cut_star1, |
| 364 | linewidth=5, linestyle=(0, (5, 7, 10, 7)), |
| 365 | facecolor=(1, 0, 0), edgecolor=(0, 0, 1)) |
| 366 | ax.add_patch(patch) |
| 367 | |
| 368 | ax.set_xlim(-1, 2) |
| 369 | ax.set_ylim(-1, 2) |
| 370 | |
| 371 | |
| 372 | def test_patch_linestyle_accents(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…