Reputation: 91
I have a simple question regarding a 3d scatter plot using the plotly package in R. It appears all of the plots are working with the exception of the 3d scatter and line plots. To test this I've tried the following code (= taken from the cheat sheet):
library(plotly)
plot_ly(type = "scatter3d", x = c(9,8,5,1), y = c(1,2,4,8),z = c(11,8,15,3),
mode = "markers")
I ended up with a plot containing only the axis and not the actual points. To troubleshoot I've added colors which got me confused as the legend with the color scale did appear but not the points themselves. I did notice the axis have the wrong scale ((80,-80),(60,-60),(100,-100)).
Furthermore, the 3d surface plot en 2d scatter plot examples worked perfectly.
Upvotes: 9
Views: 4735
Reputation: 20487
(Posted on behalf of the OP).
I reverted to the older package (4.5.6 was found to be working), please find the script below:
require(devtools)
install_version("plotly", version = "4.5.6", repos = "http://cran.us.r-project.org")
Upvotes: 8
Reputation:
Is that what you are looking forward?
> plot_ly(type = "scatter3d", x = c(9,8,5,1), y = c(1,2,4,8),z = c(11,8,15,3),
+ mode = "markers")
There is no error with your code, clear your R-consel and try again and check the version of the library as well.
Upvotes: 0