I want to create a Scatter3d plot and use the marker colorscale for conveying information. Itโs all good, the only catch is how do I show the colorscale on my plot?
def get_Scatter_plot(dframe):
#these strings e.g. x-coor , x-disp are coming from the dumped csv file
#which in turn is coming from the DYNA nodout file
xt="x-coor"
yt="y-coor"
zt="z-coor"
abs_disp=(dframe['x-disp']**2+dframe['y-disp']**2+dframe['z-disp']**2)**(0.5)
axis_range=set_axis_ranges(dframe)
trace=Scatter3d(x=dframe[xt].values,y=dframe[yt].values,z=dframe[zt].values,
mode='markers',
marker=dict(size=3,color=abs_disp,colorscale='Jet'),
legendgroup=abs_disp,
hovertext=abs_disp)
data=[trace]
layout=Layout(scene=dict(xaxis=dict(range=axis_range[xt]),
yaxis=dict(range=axis_range[yt]),
zaxis=dict(range=axis_range[zt])),
margin=dict(l=0,r=0,b=0,t=0))
fig=Figure(data=data,layout=layout)
return fig
Here is what I get by passing my data to this function: