widgetti / ipyvolume

3d plotting for Python in the Jupyter notebook based on IPython widgets using WebGL
MIT License
1.95k stars 236 forks source link

Can't see points when using scatter. #404

Closed alvaro-luque closed 2 years ago

alvaro-luque commented 2 years ago

Hi, I have been trying to use scatter() to plot some points I have saved in a vector. The idea is to generate an arbitrary number of random 3D vectors, like this (also, we will normalize each vector as if they were points on the surface of a sphere of radius 1: import numpy as np import ipyvolume as ipv

vec=np.random.randn(100,3) for i in range(vec.shape[0]): vec[i] /= np.linalg.norm(vec[i])

Then, I followed the ipyvolume scatter plot tutorial, where again they plot an arbitrary number (a thousand in this case) of random 3D points. The only difference is that our vec is the transpose of the set of coordinates plotted there. With that in mind, I did:

fig=ipv.figure() xi, yi, zi = vec.transpose()[0], vec.transpose()[1], vec.transpose()[2] ipv.scatter(xi,yi,zi) ipv.show()

Running this in a Jupyter notebook brings up a blank 3D graph with the usual top-left bar and I can rotate, but no points show up. I have to say that neither can I see the plotted dots in the mentioned tutorial.

I have followed the installation procedure listed in the docs so some clarification would be much appreciated. Thanks in advance!

alvaro-luque commented 2 years ago

I will close this since repeating the operation on Chrome web browser fixed the issue.