matplotlib:plt.subplots

import numpy as np
import matplotlib
matplotlib.use(“TkAgg”)
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.gridspec as gridspec

f,ax=plt.subplots(2,2,sharex=True,sharey=True)
ax[0,0].scatter([1,2],[1,2])
ax[0,1].scatter([1,2],[1,2])
ax[1,0].scatter([1,2],[1,2])
ax[1,1].scatter([1,2],[1,2])

plt.show()
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43055882/article/details/86518176