Skip to content

Instantly share code, notes, and snippets.

@hiccupzhu
Created June 6, 2013 08:40
Show Gist options
  • Save hiccupzhu/5720168 to your computer and use it in GitHub Desktop.
Save hiccupzhu/5720168 to your computer and use it in GitHub Desktop.
load config-file draw graphs.
import matplotlib
import matplotlib.pyplot as plt
Y = []
matplotlib.rcParams["savefig.dpi"]=80;
print matplotlib.rcParams["savefig.dpi"]
file = open("./statistic.txt", "r");
lines = file.readlines();
file.close();
for line in lines:
Y += line.split();
X = range(0, 256);
print "X=", len(X)
print "Y=", len(Y)
fig = plt.figure(figsize=(8,4))
ax = fig.add_subplot(111)
plt.xlim(0, 256)
ax.plot(X, Y)
fig.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment