码迷,mamicode.com
首页 > 其他好文 > 详细

matplotlib

时间:2018-04-27 02:22:23      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:imp   show   lines   SQ   title   otl   tle   默认   atp   

matplotlib.pylab

折线图|散点图   使用plot(x,y,展现形式)默认折线图,   ‘o’散点图    ro红色散点  设置颜色。 

 import matplotlib.pylab as py1
 x=[0,1,2,3,4,5]
 y=[0,5,6,2,7,5]
 py1.plot(x,y)
[<matplotlib.lines.Line2D object at 0x0000000005079240>]
py1.show()
 py1.plot(x,y,‘o‘)  #散点图
[<matplotlib.lines.Line2D object at 0x00000000053AA7B8>]
 py1.show()

py1.title(“标题”)

py1.xlabel(“x轴”)

py1.ylabel(“y轴”)

‘’线条样式‘’

—— 直线

-------虚线

-.-.

 py1.plot(x,y,‘-’)

 ‘’散点样式‘’

* 星型

s  方形

h  六角星

+  +号形式

 py1.plot(x,y,‘*’)

直方图使用hist

 后续学习ing

matplotlib

标签:imp   show   lines   SQ   title   otl   tle   默认   atp   

原文地址:https://www.cnblogs.com/chaoba/p/8955431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!