3D Plotly scatter plot with plane on the X axis

Hi everyone,

I am new to using Plotly and I need to add a mesh plane on the x-axis. I have got the mesh plane on the z-axis with the following:

my_data <- mtcars
library(plotly)
df <- data.frame(x = my_data$drat, y = my_data$wt, z = my_data$qsec)
planDf <- data.frame(x = rep(range(df$x, na.rm = T), 2), y = rep(range(df$y, na.rm = T), each = 2), z = 20)
plan_df_2 <- data.frame(x = rep(range(df$x, na.rm = T), 2), y = rep(range(df$y, na.rm = T), each = 2), z = 100)

my_data$gear = as.character(my_data$gear)

plot_ly(my_data) %>%
add_markers(x = ~drat, y = ~wt, z = ~qsec, color = ~gear, colors = c("firebrick", "forestgreen", "orange")) %>%
add_mesh(x = ~x, y = ~y, z = ~z, data = planDf, opacity = 0.3)

however, I want to add another plane at x = 4 but I cannot figure out how to do so - could anyone please help?

I have managed to get it displayed on the x-axis in scatterplot3d package, however, I would like to make it interactive with plotly and struggling to add such in.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.