3

I am using plotly in Jupyter Notebook with Python to generate multiple 3D plots. All the data exists as points and thus is plotted with Scatter3d. I am trying to add a time slider to this 3D data like this 2D example here:

2D Time Slider Example:
2D Time Slider Example

My plot looks like this right now:

3D data for desired Time Slider:
3D data for desired Time Slider

Each of the traces plotted has a date associated with it, so I can group them by month or whatever time frame. I don't care about the "animation" but the slider on the bottom would be nice, and I can't seem to make any progress. My code to plot these circles is below:

Code:

i=0
trace=go.Scatter3d(x=Data['X'][i],y=Data['Y'][i],z=Data['Z'][i])
layout=go.Layout(margin={'l': 0, 'r': 0, 'b': 0, 't': 0})
plot_figure = go.Figure(data=trace, layout=layout)
i=1
while i < len(Data):
    plot_figure.add_trace(go.Scatter3d(x=Data['X'][i],y=Data['Y'][i],z=Data['Z'][i],
             error_z=dict(type='constant',
                 value=Data['Error Top'][i],
                 valueminus=-Data['Error Bottom'][i],
                 thickness=0),
             surfaceaxis=1,
             surfacecolor=Data['Colors'][i],
             mode='lines',
             line=dict(color=Data['Colors'][i])))
    i=i+1    
M--
  • 25,431
  • 8
  • 61
  • 93
yourboyjoe
  • 41
  • 2

0 Answers0