def mem_svg(self, table, column, outfile):
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sb
sb.set(style="whitegrid")
svgdat = (table.
rename(columns={ column : 'Memory' }).
groupby(['Dataset', 'Threads', 'Program']).
agg({ 'Memory' : max }).
reset_index())
svgdat = svgdat.assign(MemoryMB=svgdat['Memory'] / 1000000)
threads = svgdat.Threads.unique()
if len(threads) == 1:
plot = sb.factorplot(
x='Program', y='MemoryMB', col="Dataset",
data=svgdat, kind="bar", ci=None, sharey=True)
else:
plot = sb.factorplot(
x='Threads', y='MemoryMB', col="Dataset", hue="Program",
data=svgdat, kind="bar", ci=None, sharey=True)
if len(threads) == 1:
plot = plot.set_titles('')
plot = plot.set_xlabels('Threads')
plot = plot.set_ylabels('Memory (MB)')
plot = plot.set_xticklabels(rotation=90)
plot.fig.subplots_adjust(wspace=0.35)
plot.savefig(outfile)
评论列表
文章目录