Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize mayavi window

I guess the solution is quite easy. However I can't find any example on how to change the window size of the mayavi renderer.

sample code:

import numpy as np
from tvtk.api import tvtk
from mayavi import mlab

points = np.random.normal(0, 1, (1000, 3))
ug = tvtk.UnstructuredGrid(points=points)
ug.point_data.scalars = np.sqrt(np.sum(points**2, axis=1))
ug.point_data.scalars.name = "value"
ds = mlab.pipeline.add_dataset(ug)
delaunay = mlab.pipeline.delaunay3d(ds)
iso = mlab.pipeline.iso_surface(delaunay)
iso.actor.property.opacity = 0.1
iso.contour.number_of_contours = 10
mlab.show()

I've tried the following:

scene=mlab.gcf().scene
scene.set_size((600,600))

nothing changes.

best regards and thanks in advance...

like image 495
OD IUM Avatar asked Apr 09 '26 19:04

OD IUM


1 Answers

fig = mlab.figure(size=(600,600))
#then the rest of your code
like image 60
M4rtini Avatar answered Apr 11 '26 08:04

M4rtini