matplotlib.pylab
Line Chart|Scatter chart Use plot(x, y, display form) default line chart, 'o' scatter chart ro red scatter Set color.
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("title")
py1.xlabel("x-axis")
py1.ylabel("y-axis")
''Line Style''
- straight line
-------dotted line
-.-.
:
py1.plot(x,y,‘-’)
''scatter style''
* star
s square
h six-pointed star
+ + sign form
py1.plot(x,y,‘*’)
Histogram using hist
follow-up learning