I have 2 color-coded point clouds (scatters):
fx2, fy2, fz2 = [[coord+random.random()*4 for coord in coords] for coords in [fx1, fy1, fz1]]
fig1 = go.Figure(data=[go.Scatter3d(z=fz1, x=fx1, y=fy1, mode='markers')])
fig2 = go.Figure(data=[go.Scatter3d(z=fz2, x=fx2, y=fy2, mode='markers', marker={'color': 'red'})])
fig = go.Figure(data=fig1.data + fig2.data)
This works fine, but when I want to show them as a vector field, it only shows the cones if I truncate the length of the vectors to as fraction of their intended length. Therefore, this doesnβt work:
fig = go.Figure(data=go.Cone(x=fx1, y=fy1, z=fz1, u=fx2, v=fy2, w=fz2 , sizemode="absolute", sizeref=2, anchor="tip"))
fig.update_layout(title=plot_label, autosize=False,
width=1024, height=1024,
margin=dict(l=65, r=50, b=65, t=90))
fig.show()
So what Iβd like to try next to work around the problem is, rather than plotting cones, I want to keep the two point clouds as in the first snippet of code, and connect them with line segments, in hopes that line segments wonβt trigger the bug.
But the only solution I see out there entails zipping the two 3D vectors together into 1 3D vector and then placing a None
between each pair of coordinates so as to fool Scatter
into doing line segments when it thinks its doing polylines. But then this fails to provide the different colors to differentiate the two scatters.