Skip to content

Close figs #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
closing all figures - runtime is 585 seconds
  • Loading branch information
ivanov committed Apr 26, 2011
commit bbda4976ad389011555fbfc4a7966887d08b9ae6
22 changes: 22 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_formatter_ticker():
ax.set_xlabel( "x-label 005" )
ax.autoscale_view()
fig.savefig( 'formatter_ticker_005' )
plt.close()

@image_comparison(baseline_images=['offset_points'])
def test_basic_annotate():
Expand All @@ -58,6 +59,7 @@ def test_basic_annotate():
xytext=(3, 3), textcoords='offset points' )

fig.savefig( 'offset_points' )
plt.close()

@image_comparison(baseline_images=['polar_axes'])
def test_polar_annotations():
Expand Down Expand Up @@ -92,6 +94,7 @@ def test_polar_annotations():
)

fig.savefig( 'polar_axes' )
plt.close()

#--------------------------------------------------------------------
@image_comparison(baseline_images=['polar_coords'])
Expand Down Expand Up @@ -123,6 +126,7 @@ def test_polar_coord_annotations():
ax.set_xlim( -20, 20 )
ax.set_ylim( -20, 20 )
fig.savefig( 'polar_coords' )
plt.close()

@image_comparison(baseline_images=['fill_units'])
def test_fill_units():
Expand Down Expand Up @@ -164,6 +168,7 @@ def test_fill_units():

fig.autofmt_xdate()
fig.savefig( 'fill_units' )
plt.close()

@image_comparison(baseline_images=['single_point'])
def test_single_point():
Expand All @@ -175,6 +180,7 @@ def test_single_point():
plt.plot( [1], [1], 'o' )

fig.savefig( 'single_point' )
plt.close()

@image_comparison(baseline_images=['single_date'])
def test_single_date():
Expand All @@ -189,6 +195,7 @@ def test_single_date():
plt.plot( time1, data1, 'o', color='r' )

fig.savefig( 'single_date' )
plt.close()

@image_comparison(baseline_images=['shaped_data'])
def test_shaped_data():
Expand Down Expand Up @@ -233,6 +240,7 @@ def test_shaped_data():
plt.plot( xdata[:,1], xdata[1,:], 'o' )

fig.savefig( 'shaped_data' )
plt.close()

@image_comparison(baseline_images=['const_xy'])
def test_const_xy():
Expand All @@ -248,6 +256,7 @@ def test_const_xy():
plt.plot( np.ones( (10,) ), np.ones( (10,) ), 'o' )

fig.savefig( 'const_xy' )
plt.close()

@image_comparison(baseline_images=['polar_wrap_180',
'polar_wrap_360',
Expand Down Expand Up @@ -275,6 +284,7 @@ def test_polar_wrap():
plt.rgrids( [0.05, 0.1, 0.15, 0.2, 0.25, 0.3] )

fig.savefig( 'polar_wrap_360' )
plt.close()

@image_comparison(baseline_images=['polar_units'])
def test_polar_units():
Expand Down Expand Up @@ -305,6 +315,7 @@ def test_polar_units():
y1 = [ y*km for y in y1 ]
plt.polar( x2, y1, color = "blue", thetaunits="rad", runits="km" )
assert_true( isinstance(plt.gca().get_xaxis().get_major_formatter(), units.UnitDblFormatter) )
plt.close()


@image_comparison(baseline_images=['polar_rmin'])
Expand All @@ -319,6 +330,7 @@ def test_polar_rmin():
ax.set_rmin(0.5)

fig.savefig('polar_rmin')
plt.close()

@image_comparison(baseline_images=['axvspan_epoch'])
def test_axvspan_epoch():
Expand All @@ -340,6 +352,7 @@ def test_axvspan_epoch():
ax.set_xlim( t0 - 5.0*dt, tf + 5.0*dt )

fig.savefig( 'axvspan_epoch' )
plt.close()

@image_comparison(baseline_images=['axhspan_epoch'])
def test_axhspan_epoch():
Expand All @@ -361,6 +374,7 @@ def test_axhspan_epoch():
ax.set_ylim( t0 - 5.0*dt, tf + 5.0*dt )

fig.savefig( 'axhspan_epoch' )
plt.close()


@image_comparison(baseline_images=['hexbin_extent'])
Expand All @@ -375,6 +389,7 @@ def test_hexbin_extent():

ax.hexbin(x, y, extent=[.1, .3, .6, .7])
fig.savefig('hexbin_extent')
plt.close()

@image_comparison(baseline_images=['nonfinite_limits'])
def test_nonfinite_limits():
Expand All @@ -385,6 +400,7 @@ def test_nonfinite_limits():
ax = fig.add_subplot(111)
ax.plot(x, y)
fig.savefig('nonfinite_limits')
plt.close()

@image_comparison(baseline_images=['imshow'])
def test_imshow():
Expand All @@ -401,6 +417,7 @@ def test_imshow():

ax.imshow(r)
fig.savefig('imshow')
plt.close()

@image_comparison(baseline_images=['imshow_clip'], tol=1e-2)
def test_imshow_clip():
Expand Down Expand Up @@ -428,6 +445,7 @@ def test_imshow_clip():
#Plot the image clipped by the contour
ax.imshow(r, clip_path=clip_path)
fig.savefig('imshow_clip')
plt.close()

@image_comparison(baseline_images=['polycollection_joinstyle'])
def test_polycollection_joinstyle():
Expand All @@ -446,6 +464,7 @@ def test_polycollection_joinstyle():
ax.set_yticks([])

fig.savefig('polycollection_joinstyle')
plt.close()

@image_comparison(baseline_images=['fill_between_interpolate'], tol=1e-2)
def test_fill_between_interpolate():
Expand All @@ -467,6 +486,7 @@ def test_fill_between_interpolate():
ax1.fill_between(x, y1, y2, where=y2<=y1, facecolor='red', interpolate=True)

fig.savefig('fill_between_interpolate')
plt.close()

@image_comparison(baseline_images=['symlog'])
def test_symlog():
Expand All @@ -481,6 +501,7 @@ def test_symlog():
ax.set_ylim(-1,10000000)

fig.savefig('symlog')
plt.close()

@image_comparison(baseline_images=['pcolormesh'], tol=0.02)
def test_pcolormesh():
Expand Down Expand Up @@ -511,6 +532,7 @@ def test_pcolormesh():
ax.set_yticks([])

fig.savefig('pcolormesh')
plt.close()


@image_comparison(baseline_images=['canonical'])
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/tests/test_backend_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def test_visibility():

fd = StringIO.StringIO()
fig.savefig(fd,format='svg')
plt.close()

fd.seek(0)
buf = fd.read()
Expand Down
9 changes: 9 additions & 0 deletions lib/matplotlib/tests/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def test_date_empty():
ax = fig.add_subplot(1,1,1)
ax.xaxis_date()
fig.savefig('date_empty')
plt.close()

@image_comparison(baseline_images=['date_axhspan'])
def test_date_axhspan():
Expand All @@ -26,6 +27,7 @@ def test_date_axhspan():
tf+datetime.timedelta(days=5))
fig.subplots_adjust(left=0.25)
fig.savefig('date_axhspan')
plt.close()

@image_comparison(baseline_images=['date_axvspan'])
def test_date_axvspan():
Expand All @@ -39,6 +41,7 @@ def test_date_axvspan():
tf+datetime.timedelta(days=720))
fig.autofmt_xdate()
fig.savefig('date_axvspan')
plt.close()


@image_comparison(baseline_images=['date_axhline'])
Expand All @@ -53,6 +56,7 @@ def test_date_axhline():
tf+datetime.timedelta(days=5))
fig.subplots_adjust(left=0.25)
fig.savefig('date_axhline')
plt.close()

@image_comparison(baseline_images=['date_axvline'])
def test_date_axvline():
Expand All @@ -66,6 +70,7 @@ def test_date_axvline():
tf+datetime.timedelta(days=5))
fig.autofmt_xdate()
fig.savefig('date_axvline')
plt.close()

def test_too_many_date_ticks():
# Attempt to test SF 2715172, see
Expand All @@ -82,6 +87,7 @@ def test_too_many_date_ticks():
from matplotlib.dates import DayLocator, DateFormatter, HourLocator
ax.xaxis.set_major_locator(DayLocator())
assert_raises(RuntimeError, fig.savefig, 'junk.png')
plt.close()

@image_comparison(baseline_images=['RRuleLocator_bounds'])
def test_RRuleLocator():
Expand Down Expand Up @@ -112,6 +118,7 @@ def test_RRuleLocator():
fig.autofmt_xdate()

fig.savefig( 'RRuleLocator_bounds' )
plt.close()

@image_comparison(baseline_images=['DateFormatter_fractionalSeconds'])
def test_DateFormatter():
Expand Down Expand Up @@ -140,6 +147,7 @@ def test_DateFormatter():
fig.autofmt_xdate()

fig.savefig( 'DateFormatter_fractionalSeconds' )
plt.close()

#@image_comparison(baseline_images=['empty_date_bug'])
@knownfailureif(True)
Expand All @@ -158,6 +166,7 @@ def test_empty_date_with_year_formatter():
ax.xaxis.set_major_formatter(yearFmt)

fig.savefig('empty_date_bug')
plt.close()

if __name__=='__main__':
import nose
Expand Down
5 changes: 5 additions & 0 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_image_interps():
ax3.set_ylabel('bicubic')

fig.savefig('image_interps')
plt.close()

@image_comparison(baseline_images=['figimage-0', 'figimage-1'], extensions=['png'], tol=1.5e-3)
def test_figimage():
Expand All @@ -48,6 +49,7 @@ def test_figimage():
fig.figimage(img[::-1,::-1], xo=100, yo=100, origin='lower')

fig.savefig('figimage-%d' % int(suppressComposite), dpi=100)
plt.close()

def test_image_python_io():
fig = plt.figure()
Expand All @@ -57,6 +59,7 @@ def test_image_python_io():
fig.savefig(buffer)
buffer.seek(0)
plt.imread(buffer)
plt.close()

# def test_image_unicode_io():
# fig = plt.figure()
Expand Down Expand Up @@ -108,6 +111,7 @@ def test_image_clip():
im = ax.imshow(d, extent=(-pi,pi,-pi/2,pi/2))

fig.savefig('image_clip')
plt.close()

@image_comparison(baseline_images=['imshow'])
def test_imshow():
Expand All @@ -122,6 +126,7 @@ def test_imshow():
ax.set_ylim(0,3)

fig.savefig('imshow')
plt.close()

if __name__=='__main__':
import nose
Expand Down
15 changes: 13 additions & 2 deletions lib/matplotlib/tests/test_simplification.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_clipping():
ax.set_xticks([])
ax.set_yticks([])
fig.savefig('clipping')
plt.close()

@image_comparison(baseline_images=['overflow'], tol=1e-2)
def test_overflow():
Expand All @@ -42,6 +43,7 @@ def test_overflow():
ax.set_yticks([])

fig.savefig('overflow')
plt.close()

@image_comparison(baseline_images=['clipping_diamond'])
def test_diamond():
Expand All @@ -57,6 +59,7 @@ def test_diamond():
ax.set_yticks([])

fig.savefig('clipping_diamond')
plt.close()

def test_noise():
np.random.seed(0)
Expand All @@ -72,6 +75,7 @@ def test_noise():
transform = p1[0].get_transform()
path = transform.transform_path(path)
simplified = list(path.iter_segments(simplify=(800, 600)))
plt.close()

print len(simplified)

Expand All @@ -91,6 +95,7 @@ def test_sine_plus_noise():
transform = p1[0].get_transform()
path = transform.transform_path(path)
simplified = list(path.iter_segments(simplify=(800, 600)))
plt.close()

print len(simplified)

Expand All @@ -112,6 +117,7 @@ def test_simplify_curve():
ax.set_ylim((0, 2))

fig.savefig('simplify_curve')
plt.close()

@image_comparison(baseline_images=['hatch_simplify'])
def test_hatch():
Expand All @@ -122,6 +128,7 @@ def test_hatch():
ax.set_ylim((0.45, 0.55))

fig.savefig('hatch_simplify')
plt.close()

@image_comparison(baseline_images=['fft_peaks'])
def test_fft_peaks():
Expand All @@ -138,6 +145,7 @@ def test_fft_peaks():
transform = p1[0].get_transform()
path = transform.transform_path(path)
simplified = list(path.iter_segments(simplify=(800, 600)))
plt.close()

print len(simplified)

Expand Down Expand Up @@ -185,12 +193,13 @@ def test_throw_rendering_complexity_exceeded():
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(xx, yy)
rcParams['path.simplify'] = True
try:
fig.savefig(cStringIO.StringIO())
except e:
raise e
else:
rcParams['path.simplify'] = True
finally:
plt.close()

@image_comparison(baseline_images=['clipper_edge'])
def test_clipper():
Expand All @@ -209,6 +218,7 @@ def test_clipper():

ax.set_xlim(5, 9)
fig.savefig('clipper_edge')
plt.close()

@image_comparison(baseline_images=['para_equal_perp'])
def test_para_equal_perp():
Expand All @@ -220,6 +230,7 @@ def test_para_equal_perp():
ax.plot(x + 1, y + 1)
ax.plot(x + 1, y + 1, 'ro')
fig.savefig('para_equal_perp')
plt.close()

if __name__=='__main__':
import nose
Expand Down
1 change: 1 addition & 0 deletions lib/matplotlib/tests/test_spines.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ def test_spines_axes_positions():
ax.spines['left'].set_color('none')
ax.spines['bottom'].set_color('none')
fig.savefig('spines_axes_positions')
plt.close()
Loading