Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 623
Erric Avatar asked Oct 26 '25 18:10

Erric


1 Answers

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.

like image 100
BenjaminDSmith Avatar answered Oct 29 '25 07:10

BenjaminDSmith