1

I have 3D data from a gyroscope and an accelerometer over a time period. I would like to plot these (separately of course) as 3D graphs that take into account the time variable. I am trying to graph the motions made in 3D. Each of the axes on its own is similar to a sin curve.

At the moment, I've got a 3D graph in R working with the following code:

plot_ly(fogp, x = ~x, y = ~y, z = ~z, type = 'scatter3d', mode = 'lines')

This of course doesn't take the time variable into account. How would I graph all three variables vs time? Does anyone have suggestions for graphing motion like this?

edit: I've tried with animation as well, but the point never moves, only the axes move and change scale:

plot_ly(fogp, x = ~x, y = ~y, z = ~z, type = 'scatter3d', frame = ~timestamp)
tristan
  • 98
  • 8

1 Answers1

0

Sound like you are plotting one single point over time, and the axes are changed to keep the point centered. Have you tried fixing the axes ranges?

Set the axis range for each axis to its respective [min, max] as found in the full Dataframe.

Alternatively, this topic shows how to set the range per individual frame.

Is there a way to dynamically change a plotly animation axis scale per frame?

StephanT
  • 649
  • 5
  • 12