Adds output argument

This commit is contained in:
Simon Walker
2013-11-05 16:08:00 +00:00
parent 53fd327ee3
commit 84c782f8d7
+7 -1
View File
@@ -12,7 +12,10 @@ ap = argparse.ArgumentParser()
ap.add_argument('style', help='Which rc file to use. One of %s' % available)
ap.add_argument('--plot', default='all', help='One of [scatter, hist, line, image], or '
'a comma-separated list of a subset. Default is all.')
ap.add_argument('--output', required=False, help='Render the plot to a file')
print "Here"
args = ap.parse_args()
print "Here"
matplotlib.rc_file(os.path.join(HERE, 'rc', args.style))
@@ -66,4 +69,7 @@ if 'image' in args.plot or args.plot == 'all':
ax = fig.add_subplot(224)
image(ax)
plt.show()
if args.output:
plt.savefig(args.output)
else:
plt.show()