首页 > 其他 > 详细

3.2 定义图表类型

时间:2017-03-12 01:13:30      阅读:284      评论:0      收藏:0      [点我收藏+]
 1 from matplotlib.pyplot import *
 2 x = [1, 2, 3, 4]
 3 y = [5, 4, 3, 2]
 4 
 5 figure()
 6 subplot(231)
 7 plot(x,y)
 8 
 9 subplot(232)
10 bar(x,y)
11 
12 subplot(233)
13 barh(x,y)
14 
15 subplot(234)
16 bar(y,x)
17 
18 y1= [7, 8, 5, 3]
19 bar(x, y1, bottom=y, color=r)
20 subplot(235)
21 boxplot(x)
22 
23 subplot(236)
24 scatter(x,y)
25 
26 show()

 

3.2 定义图表类型

原文:http://www.cnblogs.com/boooobao/p/6536730.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!