MayaVi: Problems exporting figures with large resolution using mlab.savefig

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MayaVi: Problems exporting figures with large resolution using mlab.savefig

Kasper Kærgaard
Hi All.

I have problems with mlab.savefig(). Everything works fine when exporting using the screen resolution, but when I try to increase the resolution using size=() or magnification=XX the exported image is not right. I have attatched the correct image and a distorted one.
Any ideas are welcome.

Regards Kasper




_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

analyzed_surfall4.png (273K) Download Attachment
analyzed_surfall9.jpg (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: MayaVi: Problems exporting figures with large resolution using mlab.savefig

Gael Varoquaux
On Tue, Feb 09, 2010 at 11:38:31AM +0100, Kasper Kærgaard wrote:
>    Hi All.

>    I have problems with mlab.savefig(). Everything works fine when exporting
>    using the screen resolution, but when I try to increase the resolution
>    using size=() or magnification=XX the exported image is not right. I have
>    attatched the correct image and a distorted one.
>    Any ideas are welcome.

What's your Mayavi version? What's your platform and your VTK version.

Also, do you save the images after calling 'mlab.show' or in 'ipython
-wthread', or in a script run without starting an event loop?

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: MayaVi: Problems exporting figures with large resolution using mlab.savefig

Kasper Kærgaard
Hi Gaël

Mayavi version 3.3.0 -VTK version 5.4.2 on windows vista with nvidia graphics card (G105M) and nvidia drivers.
I save the images in script running in an ipython -wthread. (started from python xy).
here is the code that plots and saves the image:

ww = (P1.max()-P1.min())*1.1
if True:
    fig = mlab.figure(i,size = (600,800),bgcolor=(1.0,1.0,1.0))
    for i in range(len(Y)):
        me = mlab.mesh(S1[:,:,i],P1[:,:,i]-ww*i,H1[:,:,i], opacity=1,vmin = -2, vmax = 6,colormap='Spectral')
        mlab.text(S1[20,-1,i],P1[20,-1,i]-ww*i,map[Y[i]].isoformat(),width=0.1,color=(0,0,0),z=0)
    ax = mlab.axes(z_axis_visibility = False,xlabel='',ylabel='',extent=[0,11000,-200-ww*i,1000-ww*i,-25,8],ranges =[0,11000,0,1200,-25,8])
    ax.axes.label_format = '%-#6.1f'
    ax.axes.font_factor = 1.0
    ax._label_text_property.color = (0,0,0)
    ax._title_text_property.color = (0,0,0)
    ax._property.color = (0,0,0)
    mlab.view(0,0)
    mlab.savefig(folder+'figures/analyzed_surfall10.jpg',magnification=4)

I do not call mlab.show() (iPython stops at that line if I do)
I tried using the GUI buttons to save a snapshot, and it gives me the same result

- Kasper

On Tue, Feb 9, 2010 at 11:54 AM, Gael Varoquaux <[hidden email]> wrote:
On Tue, Feb 09, 2010 at 11:38:31AM +0100, Kasper Kærgaard wrote:
>    Hi All.

>    I have problems with mlab.savefig(). Everything works fine when exporting
>    using the screen resolution, but when I try to increase the resolution
>    using size=() or magnification=XX the exported image is not right. I have
>    attatched the correct image and a distorted one.
>    Any ideas are welcome.

What's your Mayavi version? What's your platform and your VTK version.

Also, do you save the images after calling 'mlab.show' or in 'ipython
-wthread', or in a script run without starting an event loop?

Gaël
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev