Black Lives Matter. Please consider donating to Black Girls Code today.

Adding a plane to an existing scatter plot

AS$women[which(AS$women == 0)] <- ‘Men’
AS$women[which(AS$women == 1)] <- ‘Women’
AS$women <- as.factor(AS$women)

p <- plot_ly(AS, x = AS$serverHeight, y = AS$serverWeight, z = AS$speed_kmh, color = AS$women, colors = c(’#0C4B8E’, ‘#BF382A’),
marker = list(symbol = ‘circle’, sizemode = ‘diameter’), sizes = c(1, 20), size=1000) %>%
add_markers() %>%
layout(scene = list(xaxis = list(title = ‘Height’),
yaxis = list(title = ‘Weight’),
zaxis = list(title = ‘Average Speed’)))

show§

Hello everyone,

I just need to add a plane to this graph, and I have an expression of the form z =a + b.x + c.y (a, b and c real numbers; x, y and z are the variables used in the graph above)

How do I do this?

Thank you!