I have a 3D plot in plotly for R that I want to put into a presentation. Is there a way I can animate the 3D space rotating in some way as a .gif or other from R?
I understand how to make the plot, how to rotate it on my own, and how to publish it on RPubs, but can't figure out how to save it out. Example below.
# build dataframe
df <- data.frame(replicate(3,sample(0:25,50,rep=TRUE)))
# 3d scatterplot
p1 <- plot_ly(df, x = ~X1, y = ~X2, z = ~X3,
type = "scatter3d",
mode = "markers")
p1
Now we have a cool 3D scatterplot in viewer that user can rotate with mouse drags, but I want to save it out to rotate on its own. There is also a 'save to png' button in the viewer, but when I click it, a text box pops up that says "there was a problem saving your image." I'm thinking some kind of loop that saves images out at different viewer angles, then stitches them together? Any ideas appreciated.
I also tried using the orca() command and received the following error:
orca(p1,file="3dplot.png")
Error: The orca command-line utility is required for this functionality.
Not sure what it means.