8000 Add a unit test for issue #566 · mdboom/matplotlib@186d622 · GitHub
[go: up one dir, main page]

Skip to 10000 content

Commit 186d622

Browse files
committed
Add a unit test for issue matplotlib#566
1 parent 4e6b883 commit 186d622

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def test_formatter_ticker():
1515
import matplotlib.testing.jpl_units as units
1616
units.register()
1717

18+
# This should affect the tick size. (Tests issue #543)
19+
matplotlib.rcParams['lines.markeredgewidth'] = 30
20+
1821
# This essentially test to see if user specified labels get overwritten
1922
# by the auto labeler functionality of the axes.
2023
xdata = [ x*units.sec for x in range(10) ]
@@ -319,7 +322,7 @@ def test_polar_theta_position():
319322
ax.plot(theta, r)
320323
ax.set_theta_zero_location("NW")
321324
ax.set_theta_direction('clockwise')
322-
325+
323326
@image_comparison(baseline_images=['axvspan_epoch'])
324327
def test_axvspan_epoch():
325328
from datetime import datetime
@@ -508,7 +511,7 @@ def test_symlog2():
508511
ax.set_xscale('symlog', linthreshx=0.01)
509512
ax.grid(True)
510513
ax.set_ylim(-0.1, 0.1)
511-
514+
512515
@image_comparison(baseline_images=['pcolormesh'], tol=0.02)
513516
def test_pcolormesh():
514517
n = 12
@@ -542,7 +545,7 @@ def test_pcolormesh():
542545
ax.set_title('gouraud')
543546
ax.set_xticks([])
544547
ax.set_yticks([])
545-
548+
546549

547550
@image_comparison(baseline_images=['canonical'])
548551
def test_canonical():
@@ -625,7 +628,21 @@ def test_markevery_line():
625628
ax.plot(x, y, '-+', markevery=(5, 20), label='mark every 5 starting at 10')
626629
ax.legend()
627630

628-
631+
def test_annotation_failure():
632+
"""See issue #566"""
633+
import cStringIO
634+
plt.plot([1, 2, 3, 4], [0, -1, -2, 8])
635+
plt.annotate("Blah", xy=(2, 2), xytext=(-20,-20),
636+
textcoords='offset points',
637+
bbox=dict(boxstyle='round,pad=0.5'),
638+
arrowprops=dict(arrowstyle='fancy',
639+
connectionstyle='arc3,rad=0'))
640+
641+
plt.savefig(cStringIO.StringIO())
642+
643+
629644
if __name__=='__main__':
630645
import nose
631646
nose.runmodule(argv=['-s','--with-doctest'], exit=False)
647+
648+

0 commit comments

Comments
 (0)
0