Python matplot画散列图

时间:2014-12-19 00:21:25   收藏:0   阅读:527

同matlab一样,matplot也可画散列图scatter。

 

bubuko.com,布布扣
 1 import numpy as np
 2 import matplotlib.pyplot as plt
 3 #fig = plt.figure()
 4 #ax = fig.add_subplot(111)
 5 a1 = np.array([1, 2, 3, 4])
 6 a2 = np.array([1, 2, 3, 4])
 7 #ax.scatter(np.random.rand(5), np.random.rand(5))
 8 #mark = [‘s‘,‘o‘,‘^‘,‘v‘,‘>‘,‘<‘,‘d‘,‘p‘,‘h‘,‘8‘,‘+‘,‘*‘]
 9 #ax.scatter(a1, a2, marker=‘s‘, color=‘blue‘)
10 plt.scatter(a1, a2, marker=s, color=blue, label="TT")
11 #fig.show()
12 plt.legend()
13 plt.show()
View Code

 

显示结果:
bubuko.com,布布扣

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!