Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 50ba22f

Browse files
committed
Added image test for arrow patches.
All bbox's in patches.BoxStyle are included in the test image.
1 parent 1aa2e58 commit 50ba22f

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

41.5 KB
Loading

lib/matplotlib/tests/test_arrow_patches.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,27 @@ def test_fancyarrow():
3030
ax.tick_params(labelleft=False, labelbottom=False)
3131

3232

33+
@image_comparison(baseline_images=['boxarrow_test_image'], extensions=['png'])
34+
def test_boxarrow():
35+
36+
styles = matplotlib.patches.BoxStyle.get_styles()
37+
38+
n = len(styles)
39+
spacing = 1.2
40+
41+
figheight = (n * spacing + .5)
42+
fig1 = plt.figure(1, figsize=(4 / 1.5, figheight / 1.5))
43+
44+
fontsize = 0.3 * 72
45+
46+
for i, stylename in enumerate(sorted(styles.keys())):
47+
fig1.text(0.5, ((n - i) * spacing - 0.5)/figheight, stylename,
48+
ha="center",
49+
size=fontsize,
50+
transform=fig1.transFigure,
51+
bbox=dict(boxstyle=stylename, fc="w", ec="k"))
52+
53+
3354
if __name__ == '__main__':
3455
import nose
3556
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)