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

Function test_patheffect3

lib/matplotlib/tests/test_patheffects.py:50–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48@image_comparison(['patheffect3'], style='mpl20',
49 tol=0.02 if sys.platform == 'darwin' else 0)
50def test_patheffect3():
51 plt.figure(figsize=(8, 6))
52 p1, = plt.plot([1, 3, 5, 4, 3], 'o-b', lw=4)
53 p1.set_path_effects([path_effects.SimpleLineShadow(),
54 path_effects.Normal()])
55 plt.title(
56 r'testing$^{123}$',
57 path_effects=[path_effects.withStroke(linewidth=1, foreground="r")])
58 leg = plt.legend([p1], [r'Line 1$^2$'], fancybox=True, loc='upper left')
59 leg.legendPatch.set_path_effects([path_effects.withSimplePatchShadow()])
60
61 text = plt.text(2, 3, 'Drop test', color='white',
62 bbox={'boxstyle': 'circle,pad=0.1', 'color': 'red'})
63 pe = [path_effects.Stroke(linewidth=3.75, foreground='k'),
64 path_effects.withSimplePatchShadow((6, -3), shadow_rgbFace='blue')]
65 text.set_path_effects(pe)
66 text.get_bbox_patch().set_path_effects(pe)
67
68 pe = [path_effects.PathPatchEffect(offset=(4, -4), hatch='xxxx',
69 facecolor='gray'),
70 path_effects.PathPatchEffect(edgecolor='white', facecolor='black',
71 lw=1.1)]
72
73 t = plt.gcf().text(0.02, 0.1, 'Hatch shadow', fontsize=75, weight=1000,
74 va='center')
75 t.set_path_effects(pe)
76
77
78@image_comparison(['stroked_text.png'], style='mpl20')

Callers

nothing calls this directly

Calls 6

figureMethod · 0.80
set_path_effectsMethod · 0.80
get_bbox_patchMethod · 0.80
plotMethod · 0.45
legendMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…