def plot():
'''
'''
# Register the functions
builtins.__dict__.update(globals())
# Loop over various dataset sizes
Narr = np.logspace(0, 5, 5)
tpp = np.zeros_like(Narr)
tbm = np.zeros_like(Narr)
tps = np.zeros_like(Narr)
for i, N in enumerate(Narr):
tpp[i] = timeit.timeit('run_pp(%d)' % N, number = 10) / 10.
if batman is not None:
tbm[i] = timeit.timeit('run_bm(%d)' % N, number = 10) / 10.
if ps is not None:
tps[i] = timeit.timeit('run_ps(%d)' % N, number = 10) / 10.
pl.plot(Narr, tpp, '-o', label = 'planetplanet')
if batman is not None:
pl.plot(Narr, tbm, '-o', label = 'batman')
if ps is not None:
pl.plot(Narr, tps, '-o', label = 'pysyzygy')
pl.legend()
pl.yscale('log')
pl.xscale('log')
pl.ylabel('Time [seconds]', fontweight = 'bold')
pl.xlabel('Number of datapoints', fontweight = 'bold')
评论列表
文章目录