Created
May 13, 2016 07:00
-
-
Save haoliplus/f6bc510c72326a127c27e8818b4b1649 to your computer and use it in GitHub Desktop.
Using matplotllib to plot
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
import matplotlib | |
# if your environment has no desktop. | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
# A scatter map. | |
plt.figure(figsize=(width,height)) | |
plt.scatter(x,y) | |
plt.show | |
plt.savefig('scatter.png') | |
# A hist map | |
n, bins, patches = plt.hist(x,bins=10,range=None,normed=False, normed=1, facecolor='g', alpha=0.75) | |
plt.xlabel('Rate') | |
plt.ylabel('Count') | |
plt.title('img_rate') | |
plt.axis([x_min, x_max, | |
y_min, y_max]) | |
plt.grid(True) | |
# plt.show() | |
plt.savefig('hist.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment