猛跑小猪
这是您要实现的目标的示例:fig, ax = plt.subplots(2, 2, figsize=(20, 10))# hide axes# fig.patch.set_visible(False)ax[0][0].axis('off')ax[0][1].axis('off')ax[0][1].axis('tight')ax[0][0].axis('tight')df = pd.DataFrame(np.random.rand(10, 4), columns=list('ABCD'))ax[0][0].table(cellText=df.head().values, colLabels=df.columns, loc='center')ax[0][1].table(cellText=df.describe().values, colLabels=df.describe().columns, rowLabels=df.describe().index, loc='center')df.plot(kind='hist', ax=ax[1][0])df.plot(kind='box', ax=ax[1][1])fig.tight_layout()plt.show()