1. Python的figure参数主要有:9yr免费资源网
def figure(num=None, # autoincrement if None, else integer from 1-N
figsize=None, # defaults to rc figure.figsize
dpi=None, # defaults to rc figure.dpi
facecolor=None, # defaults to rc figure.facecolor
edgecolor=None, # defaults to rc figure.edgecolor
frameon=True,
FigureClass=Figure,
clear=False,
**kwargs
):
可以设置图片大小、分辨率、颜色等。9yr免费资源网
2. subplot子图绘制,子图的绘图参数可以分别设置9yr免费资源网
plt.figure(1)
x1 = np.linspace(-0.2, 2, 10)
y1 = x1**2 + 0.3
plt.subplot(121)
plt.scatter(x1, y1)
plt.xlabel('X')
plt.ylabel('Y')
plt.title('test_1')
x2 = np.linspace(-0.2, 2, 10)
y2 = x2 + 0.3
plt.subplot(122)
plt.plot(x2, y2, color="red"