Matplotlib add_axes在jupyterlab中无法正常工作

时间:2020-09-08 08:59:52

标签: python matplotlib jupyter-lab

考虑以下代码

import matplotlib
import matplotlib.pyplot as plt 
print("Version: ",matplotlib.__version__)
fig = plt.figure(figsize=(5,5),facecolor="gray") 
ax1 = fig.add_axes([0., 0., 1, 1],facecolor="white") 
plt.savefig("test.png")
plt.show()

我只想拥有可以填满整个图形的轴,但是在jupyter实验室中它却以某种方式收缩了。输出“ test.png”虽然可以。我该如何解决? enter image description here

0 个答案:

没有答案