3

我有一个看起来像......云的点云。它在某些地方有凸起的特征​​,在其他地方有“折痕”。

为了说明我的问题,我在下面附上了一张示例图片(用于创建第一个点云的脚本在最后)。

在此处输入图像描述

但是,由于所有点都是红色的,所以蓝色矩形内的拓扑结构是看不到的,并且没有人工照明。拓扑更好地显示在同一数据集的不同视图中(第 2 和第 3 图像)。已包含第二种颜色以进一步说明这一点。

在此处输入图像描述

有没有办法在散点图中添加某种照明,使折痕/凸起更加明显?

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()
4

0 回答 0