You cannot set transparency directly. However, you can save the shape with a background color (other than the foreground color) and use ImageMagick to remove the background
for instance
mlab.figure(size = (1024,768),\ bgcolor = (1,1,1), fgcolor = (0.5, 0.5, 0.5))
now use ImageMagick to remove the background
convert pure_beauty.png -transparent white pure_transparent_beauty.png
as shown here .
source share