enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 284 forks source link

Opening a window larger than the screen #1110

Closed isarandi closed 2 years ago

isarandi commented 2 years ago

Mayavi works very well to generate video animations. I'm using mlab.animate and mlab.screenshot to animate and save the frames.

My problem is, if I want to generate a high-res 1080 visualization, but my actual screen is smaller than 1920x1080. Even if I specify (1920, 1080) as the size argument to mlab.figure(), the window ends up as a "maximized" window. I don't mean a full-screen application, but "maximized" as if I press the "square-icon" button next to the close button on a window. This, however, results in lower than 1920x1080 resolution. After this, I can resize the window manually by dragging the corner of the window, but it's hard to get it pixel-perfectly to 1920x1080.

Is there a way to avoid the Mayavi window snapping to "maximize" at the beginning? I tried fig.scene.renderer.render_window.set(full_screen=False) but that didn't make any difference, as it seems to be about actual full-screen where the entire screen shows the mayavi content, not about the "maximization" of the window.

Using pyvirtualdisplay is indeed a workaround but then GPU hardware acceleration is lost and the rendering is much slower.

Environment:

isarandi commented 2 years ago

Apparently this is not a Mayavi-specific issue, but probably something to do with Gnome (and potentially X).

jwma0725 commented 1 year ago

Hi @isarandi, do you know how to close the GUI? I want to save 40000 pictures. If I open GUI everytime, the cost is high.

prabhuramachandran commented 1 year ago

You may find the offscreen option a bit more helpful if it works for you. See https://mayavi.readthedocs.io/en/latest/tips.html#avoiding-the-rendering-window