0

我有一个 3D 点云的散点图(见图)。绿色点实际上形成了星形的挤压,蓝色是五边形等,但这很难看到。所以我想对点云进行一些“着色”。可以对表面做这种事情(就像在这里讨论的那样:

我目前拥有的代码:

import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()  # for plot styling

filename = sys.argv[1]
# flow_events = np.loadtxt(filename, comments='#')
flow_events = pd.read_csv(filename, delimiter = "\t", skiprows=1, names=["event_x", "event_y", "event_ts", "event_label"])
n_flow_events = flow_events.values

# start = int(n_flow_events.shape[0]/3.0)
end = int(n_flow_events.shape[0]/10.0*7)
start = 0
# end = n_flow_events.shape[0]

events = n_flow_events[start:end, :]

number_to_display = 5
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(events[0::number_to_display, 0], events[0::number_to_display, 1], events[0::number_to_display, 2], c=(events[0::number_to_display, 3]+4), s=4, cmap=plt.cm.brg)

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('time [s]')

plt.show()

点云

4

1 回答 1

0

所以这不完全是我提出的问题的解决方案,但我最终做了淡紫色的建议: 黑色点云帽

于 2018-10-26T18:54:33.933 回答