matplotlib

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

猜你喜欢

转载自www.cnblogs.com/chaoba/p/8955431.html