Estoy tratando de guardar las gráficas que hago usando matplotlib; sin embargo, las imágenes se guardan en blanco.Matplotlib (pyplot) savefig muestra la imagen en blanco
Aquí está mi código:
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)
Y tessstttyyy.png está en blanco (también tratado con .jpg)
se olvidó de quitar la parte T0 ... se comentó anteriormente. – tylerthemiler
Sí, eliminé el programa por completo y funcionó, eso tiene sentido ... – tylerthemiler
Esto es genial, funciona como un amuleto – denvar