Add regression plane in R using Plotly
问题 I recently tried to plot a regression pane in RStudio using the plotly library and read this post: Add Regression Plane to 3d Scatter Plot in Plotly I followed the exact same procedure and ended up with a regression plane, which is obviously not correct: EDIT: I followed the proposal in the first answer and my result looks like this: Here is my code, I commented every step: sm is the data.frame I used library(reshape2); sm <- read.delim("Supermodel.dat", header = TRUE); x1 <- sm$age x2 <- sm