前言:
matplotlib是python最常用的绘图库,能帮你画出美丽的各种图
导入
包含了中文显示,屏外显示
import matplotlib.pyplot as plt
import matplotlib...['axes.unicode_minus'] = False
画出第一个图形
figure图形,画的每个图只有一个figure对象
x= np.arange(-3,3,0.1)
y1=np.sin...image.png
创建子图
在一个figure中显示多个图片
面向过程的方法,一步一步创建
x1=[1,2,3]
y1=[5,7,4]
x2=[1,2,3]
y2=[10,14,12]
plt.figure...#创建图形
fig=plt.figure()
#创建子图
ax1=fig.add_subplot(221)
ax2=fig.add_subplot(222)
ax3=fig.add_subplot(212...image.png
后记:
线图先到这,还有柱状图,散点图,3d图等待续……
你可能感冒的文章:
我的机器学习numpy篇
我的机器学习pandas篇
我的机器学习微积分篇