histo_spheric.py 364 B

12345678910111213
  1. """A uniform distribution on a plane
  2. is not uniform on a sphere"""
  3. import numpy as np
  4. from vedo.pyplot import histogram
  5. from vedo import Plotter
  6. phi = np.random.rand(1000)*np.pi*2
  7. the = np.random.rand(1000)*np.pi
  8. h = histogram(the, phi, mode='spheric').add_scalarbar()
  9. plt = Plotter(axes=12).add_ambient_occlusion(0.05)
  10. plt.show(h, __doc__, viewup='z').close()