Mercurial > hg > numerics
changeset 121:e259aa9ee18f
fix up how this works slightly
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 15 Mar 2015 21:02:57 -0700 |
parents | 4e0c6887604e |
children | 19f3d071bb73 |
files | numerics/plot.py |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/numerics/plot.py Sun Mar 15 20:58:15 2015 -0700 +++ b/numerics/plot.py Sun Mar 15 21:02:57 2015 -0700 @@ -176,12 +176,13 @@ for i in range(1, len(data)): plot_fcn(data[0], data[i], label=str(i), marker='.', color=next(colors)) - plt.show() + # save plot + if options.output: + plt.savefig(options.output) + print ("Figure saved to file://{}".format(os.path.abspath(options.output))) - # display - output = options.output or tempfile.mktemp(suffix='.png') - plt.savefig(output) - Displayer()(output) + # display plot, I guess + plt.show() if __name__ == '__main__': main()