MCPcopy Create free account
hub / github.com/PythonOT/POT / plot_sphere

Function plot_sphere

examples/backends/plot_ssw_unif_torch.py:48–60  ·  view source on GitHub ↗
(ax)

Source from the content-addressed store, hash-verified

46
47
48def plot_sphere(ax):
49 # Create a sphere using spherical coordinates
50 phi = np.linspace(0, 2 * np.pi, 100)
51 theta = np.linspace(0, np.pi, 100)
52 phi, theta = np.meshgrid(phi, theta)
53
54 # Compute the spherical coordinates
55 X = np.sin(theta) * np.cos(phi)
56 Y = np.sin(theta) * np.sin(phi)
57 Z = np.cos(theta)
58
59 # Plot the wireframe
60 ax.plot_wireframe(X, Y, Z, color="gray", alpha=0.3)
61
62
63# plot the distributions

Callers 2

_update_plotFunction · 0.85

Calls 2

linspaceMethod · 0.45
meshgridMethod · 0.45

Tested by

no test coverage detected