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

Function test_patch_linestyle_accents

lib/matplotlib/tests/test_patches.py:372–395  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

370
371
372def test_patch_linestyle_accents():
373 #: Test if linestyle can also be specified with short mnemonics like "--"
374 #: c.f. GitHub issue #2136
375 star = mpath.Path.unit_regular_star(6)
376 circle = mpath.Path.unit_circle()
377 # concatenate the star with an internal cutout of the circle
378 verts = np.concatenate([circle.vertices, star.vertices[::-1]])
379 codes = np.concatenate([circle.codes, star.codes])
380
381 linestyles = ["-", "--", "-.", ":",
382 "solid", "dashed", "dashdot", "dotted"]
383
384 fig, ax = plt.subplots()
385 for i, ls in enumerate(linestyles):
386 star = mpath.Path(verts + i, codes)
387 patch = mpatches.PathPatch(star,
388 linewidth=3, linestyle=ls,
389 facecolor=(1, 0, 0),
390 edgecolor=(0, 0, 1))
391 ax.add_patch(patch)
392
393 ax.set_xlim([-1, i + 1])
394 ax.set_ylim([-1, i + 1])
395 fig.canvas.draw()
396
397
398@check_figures_equal()

Callers

nothing calls this directly

Calls 7

unit_regular_starMethod · 0.80
unit_circleMethod · 0.80
add_patchMethod · 0.80
subplotsMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…