pythonmlabmayavimayavi.mlab

Export high quality images in Mayavi


I'm trying to export images using mayavi scripts

from mayavi import mlab

# data to be exported in image

mlab.savefig('output.png')

But the exported image is blurry. I have read from Mayavi docs and searched from Google about this problem but I'm unable to find possible solution.

Is there any method that can export high quality images in Mayavi?


Solution

  • The Mayavi default figure size is 480 x 340. You can improve the resolution by manually increasing the figure size, e.g.:

    fig = mlab.figure(size=(1024, 1024))
    

    I've tested this for .png and .pdf images.