import numpy as np
import sys
import matplotlib as mpl
import matplotlib.pyplot as plt
我使用以下代码保存图像
fig, ax = plt.subplots(frameon=False)
ax.axis ('off')
ax.imshow (array[:,:,0,0,0])
fig.savefig ("file.png", bbox_inches='tight')
但是,我得到的是 很明显这里还有白色的边界。 我该怎么摆脱它?
array.shape是:(256,256,1,1,3)
看看我的例子,它可能会帮助你:
对上述答案稍加修改:
相关问题 更多 >
编程相关推荐