# -*- coding: gb2312 -*-
import matplotlib.pyplot as plt
fig=plt.figure()
ax=fig.add_subplot(2,2,1)
ax=fig.add_subplot(2,2,2)
ax=fig.add_subplot(2,2,3)
ax=fig.add_axes([0.2,0.4,0.2,0.4])
for i in fig.axes:  #依次获取每一个子图
    i.plot([1,2],[2,3])
t=fig.gca()#获取当前子图
t.scatter([5,2],[6,2],c='r')
plt.show()

创建多个子图

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-11-19
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-05-30
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案