def create_plot_file(trajFile, plot_filename, plot_others=False, verbose = False):
"""
Creates plot to demonstrate performance of smarty or smirky
trajFile - csv file generated by smarty, smarty_elemental, or smirky
plot_filename - pdf to save plot file to
plot_others - if True plots data for all reftypes separately, optional
"""
data = pd.read_csv(trajFile, quotechar="'")
numerator = data.columns[-2].lower()
timeseries = load_trajectory(trajFile)
time_fractions = scores_vs_time(timeseries, numerator)
max_score = max(time_fractions['all']) *100.0
if verbose: print("Maximum score was %.1f %%" % max_score)
# plot overall score
pl.plot( time_fractions['all'], 'k-', linewidth = 2.0)
if plot_others:
reftypes = [k for k in time_fractions]
reftypes.remove('all')
# Plot scors for individual types
for reftype in reftypes:
pl.plot(time_fractions[reftype])
pl.legend(['all']+reftypes, loc='lower right')
pl.xlabel('Iterations')
pl.ylabel('Fraction of reference type found')
pl.ylim(-0.1, 1.1)
pl.savefig(plot_filename)
评论列表
文章目录