Created
December 1, 2015 09:25
-
-
Save sordina/5de735198c3250538075 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import matplotlib as plt | |
import pandas as pd | |
import sys | |
import os | |
outname = "/tmp/plot-columns-{}.png".format(os.getpid()) | |
infile = None | |
if len(sys.argv) > 1: | |
infile = sys.argv[1] | |
else: | |
infile = sys.stdin | |
# TODO: This only allows for up to 2 columns... | |
d = pd.read_csv(infile, header=None) | |
p = d.plot(linewidth=3,secondary_y=d.columns.values[1:], figsize=(25,8)) | |
f = p.get_figure() | |
f.savefig(outname) | |
print outname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment