def plotJoints(self, ax, joint, color='nice', jcolor=None):
"""
Plot connected joints
:type ax: axis to plot on
:type joint: joints to connect
:type color: line color
"""
color_index = 0
for i in range(joint.shape[0]):
ax.scatter(joint[i, 0], joint[i, 1], c=(self.jointcolors[color_index % len(self.jointcolors)] if jcolor is None else jcolor), marker='.', s=400)
color_index += 1
for i in range(len(self.jointConnections)):
ax.plot(numpy.hstack((joint[self.jointConnections[i][0], 0], joint[self.jointConnections[i][1], 0])),
numpy.hstack((joint[self.jointConnections[i][0], 1], joint[self.jointConnections[i][1], 1])),
c=(color if color is not 'nice' else self.jointConnectionColors[i]), linewidth=2.0)
评论列表
文章目录