I have a point cloud that looks like ...a cloud. It has bulging features in some places, and "creases" in other places.
To illustrate my issue, I've attached a sample image below (the script used to create the first point cloud is at the end).
However, there is topology within the blue rectangle that cannot be seen since all the dots are red, and there is no artificial lighting. The topology is better shown in different views of the same dataset (2nd and 3rd images). A second color has been included to further illustrate the point.
Is there any way to add some sort of lighting to a scatter plot, so that the creases/bulges are more apparent?
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
vimport numpy as np
def randrange(n, vmin, vmax):
return (vmax - vmin)*np.random.rand(n) + vmin
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
n = 3000
# For each set of style and range settings, plot n random points in the box
# defined by x in [23, 32], y in [0, 100], z in [zlow, zhigh].
for c, m, zlow, zhigh in [('r', 'o', -50, -25)]:
xs = randrange(n, -5000, 5000)
ys = randrange(n, -5000, 5000)
#zs = xs**2+ys**2
zs = (0.1*xs)**2-(0.1*ys**2)-5000
zs2 = (0.3*xs)**2-(ys**2)-5000
#zs = randrange(n, zlow, zhigh)
ax.scatter(xs, ys, zs, c=c, marker=m)
ax.scatter(xs, ys, zs2, c=c, marker=m)
ax.view_init(elev=28., azim=-56)
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()