Matplotlib is a powerful toolkit for Python drawing and data visualization.
Installation method: Pip Install Matplotlib
Reference method: Import Matplotlib.pyplot as Plt
Drawing function: Plt.plot ()
Display Image: Plt.show ()
Simple example:
Import Matplotlib.pyplot as Pltin [269]: x = np.linspace (5,15,1000) in [+]: y = x*xIn [271]: PLT . plot (x, y) out[271]: [<matplotlib.lines.line2d at 0x10bdbd198>]in [272]: Plt.show ()
Image
Plot function:
- Linetype LineStyle (-,-.,--,.. )
- Point type marker (V,^,s,*,h,+,x,d,o,... )
- Colour Color (b,g,r,y,k,w,... )
- Plot function plots multiple curves
- Title: Set_title
- X-axis: Set_xlabel
- Y-Axis: Y_label
- Other types of images:
Canvas and graph:
Canvas: Figure
Figure: Subplot
- Ax1 = Fig.add_subplot (2,2,1) #2行2列放第一个位置
Adjust Sub-chart spacing:
- Subplots_adjust (left, bottom, right, top, wspace, hspace)
Python Data analysis----matplotlib