matplotlib를 사용하여 만든 플롯을 저장하려고합니다. 그러나 이미지는 공백으로 저장됩니다.Matplotlib (pyplot) savefig가 공백 이미지를 출력합니다.
plt.subplot(121)
plt.imshow(dataStack, cmap=mpl.cm.bone)
plt.subplot(122)
y = copy.deepcopy(tumorStack)
y = np.ma.masked_where(y == 0, y)
plt.imshow(dataStack, cmap=mpl.cm.bone)
plt.imshow(y, cmap=mpl.cm.jet_r, interpolation='nearest')
if T0 is not None:
plt.subplot(123)
plt.imshow(T0, cmap=mpl.cm.bone)
#plt.subplot(124)
#Autozoom
#else:
#plt.subplot(124)
#Autozoom
plt.show()
plt.draw()
plt.savefig('tessstttyyy.png', dpi=100)
그리고 tessstttyyy.png 빈 (도 .JPG으로 시도)입니다
이
plt.savefig()
는 T0 부분을 제거 잊으 후 – tylerthemiler그래, 나는 쇼를 전부 제거했고 그것은 효과가 있었다. 그러나 그것은 의미가있다. – tylerthemiler
이것은 멋지다, 매력처럼 작동한다 – denvar