File: histo_spheric.py

package info (click to toggle)
vedo 2025.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,404 kB
  • sloc: python: 64,792; javascript: 1,932; xml: 437; sh: 139; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""A uniform distribution on a plane
is not uniform on a sphere"""
import numpy as np
from vedo.pyplot import histogram
from vedo import Plotter

phi = np.random.rand(1000)*np.pi*2
the = np.random.rand(1000)*np.pi

h = histogram(the, phi, mode='spheric').add_scalarbar()

plt = Plotter(axes=12).add_ambient_occlusion(0.05)
plt.show(h, __doc__, viewup='z').close()