Saturday, 8 May 2021

mayavi data not showing until clicking into image

I am using mayavi to plot some 3D data set as a scatter plot using mayavi.mlab.points3d, see the code below. In principle everything works perfectly fine. However, the only thing is that I need to click into the image or rescale the window before the data shows up, i.e. I can only see the blank background. Is there anything that I am missing here or is there any way to update the plot right after generating the figure?

I am using mayavi 4.7.2 and Python 3.8 and I have the same problem in PyCharm and jupyter.

import mayavi.mlab as mlab

f = mlab.figure()

x = np.linspace(0, 10, 11)
y = x**2
z = y**3

nodes = mlab.points3d(x, y, z)

mlab.show()


from mayavi data not showing until clicking into image

No comments:

Post a Comment