So I am trying to save a figure using Mayavi. The code is shown below.
mlab.figure(1, bgcolor=(1, 1, 1), fgcolor=(0.5, 0.5, 0.5))
mlab.contour3d(i, a, d, abs(ber), contours=10, opacity=0.5, colormap='hot')
mlab.outline()
mlab.colorbar(orientation='vertical')
mlab.axes(color=(0.5,0.5,0.5), line_width=4, xlabel='I', ylabel='A', zlabel='D')
mlab.move(forward=-4, right=-4)
mlab.savefig('abc.png', figure=mlab.gcf(), magnification=2)
mlab.show()
The data gets rendered on the screen ok. For example:
But when I do a savefig()
unfortunately there seems to be a problem. I get a blank figure. I even tried to do a screenshot()
and plot that using pylab.imshow()
but that turned out to be blank as well. I even tried to save directly with the save button on the mlab window, and even this gives a blank image!
I have already checked [ mayavi mlab.savefig() gives an empty image ] but that doesnt seem to be doing the trick.
I am beginning to suspect that the backend is a problem. I am using wxPython on a Windows 7 system with a Qt backend. I also tried with pretty much all the backends I had, even with a normal non-interactive console and it doesnt work.
Does anyone have any experience with this??