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

Skip to content

Commit 11d026a

Browse files
committed
test conversion: move old-style test to new-style test
svn path=/trunk/matplotlib/; revision=7684
1 parent 9f49dc9 commit 11d026a

3 files changed

Lines changed: 17 additions & 21 deletions

File tree

test/test_plots/baseline/TestAnnotation/offset_points.png renamed to lib/matplotlib/tests/baseline_images/test_axes/offset_points.png

File renamed without changes.

lib/matplotlib/tests/test_axes.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,20 @@ def test_formatter_ticker():
4141
ax.set_xlabel( "x-label 005" )
4242
ax.autoscale_view()
4343
fig.savefig( 'formatter_ticker_005' )
44+
45+
@image_comparison(baseline_images=['offset_points'])
46+
def test_basic_annotate():
47+
# Setup some data
48+
t = np.arange( 0.0, 5.0, 0.01 )
49+
s = np.cos( 2.0*np.pi * t )
50+
51+
# Offset Points
52+
53+
fig = pylab.figure()
54+
ax = fig.add_subplot( 111, autoscale_on=False, xlim=(-1,5), ylim=(-3,5) )
55+
line, = ax.plot( t, s, lw=3, color='purple' )
56+
57+
ax.annotate( 'local max', xy=(3, 1), xycoords='data',
58+
xytext=(3, 3), textcoords='offset points' )
59+
60+
fig.savefig( 'offset_points' )

test/test_plots/TestAnnotation.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,6 @@ def tearDown( self ):
4141
"""Clean-up any generated files here."""
4242
pass
4343

44-
#--------------------------------------------------------------------
45-
def testBasicAnnotate( self ):
46-
"""Basic Annotations"""
47-
48-
# Setup some data
49-
t = npy.arange( 0.0, 5.0, 0.01 )
50-
s = npy.cos( 2.0*npy.pi * t )
51-
52-
# Offset Points
53-
fname = self.outFile( "offset_points.png" )
54-
55-
fig = figure()
56-
ax = fig.add_subplot( 111, autoscale_on=False, xlim=(-1,5), ylim=(-3,5) )
57-
line, = ax.plot( t, s, lw=3, color='purple' )
58-
59-
ax.annotate( 'local max', xy=(3, 1), xycoords='data',
60-
xytext=(3, 3), textcoords='offset points' )
61-
62-
fig.savefig( fname )
63-
self.checkImage( fname )
64-
6544
#--------------------------------------------------------------------
6645
def testPolarAnnotations( self ):
6746
"""Polar Plot Annotations"""

0 commit comments

Comments
 (0)