()
| 302 | |
| 303 | @image_comparison(['patch_alpha_override'], remove_text=True, style='_classic_test') |
| 304 | def test_patch_alpha_override(): |
| 305 | #: Test checks that specifying an alpha attribute for a patch or |
| 306 | #: collection will override any alpha component of the facecolor |
| 307 | #: or edgecolor. |
| 308 | star = mpath.Path.unit_regular_star(6) |
| 309 | circle = mpath.Path.unit_circle() |
| 310 | # concatenate the star with an internal cutout of the circle |
| 311 | verts = np.concatenate([circle.vertices, star.vertices[::-1]]) |
| 312 | codes = np.concatenate([circle.codes, star.codes]) |
| 313 | cut_star1 = mpath.Path(verts, codes) |
| 314 | cut_star2 = mpath.Path(verts + 1, codes) |
| 315 | |
| 316 | ax = plt.axes() |
| 317 | col = mcollections.PathCollection([cut_star2], |
| 318 | linewidth=5, linestyles='dashdot', |
| 319 | alpha=0.25, |
| 320 | facecolor=(1, 0, 0, 0.5), |
| 321 | edgecolor=(0, 0, 1, 0.75)) |
| 322 | ax.add_collection(col) |
| 323 | |
| 324 | patch = mpatches.PathPatch(cut_star1, |
| 325 | linewidth=5, linestyle='dashdot', |
| 326 | alpha=0.25, |
| 327 | facecolor=(1, 0, 0, 0.5), |
| 328 | edgecolor=(0, 0, 1, 0.75)) |
| 329 | ax.add_patch(patch) |
| 330 | |
| 331 | ax.set_xlim(-1, 2) |
| 332 | ax.set_ylim(-1, 2) |
| 333 | |
| 334 | |
| 335 | @mpl.style.context('default') |
nothing calls this directly
no test coverage detected
searching dependent graphs…