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.
3D scatter plot with Plotly Express. Plotly Express is the easy-to-use, high-level interface to Plotly, which operates on a variety of types of data and produces easy-to-style figures. Like the 2D scatter plot px. scatter , the 3D function px.
(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")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With