diff --git a/showstyle.py b/showstyle.py index b80e498..2420f5f 100755 --- a/showstyle.py +++ b/showstyle.py @@ -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()