Plotly - different color scales for multiple surfaces

@empet
Thank you again Empet. I managed to get two different colorscales as I wanted them by using the colorscale key. Apparently in R it should be coded as list(c(0,1),c("rgb(107,184,214)","rgb(0,90,124)")).

It gives something like that https://plot.ly/~sebastien1785/20/ using the following code:

p6 <- plot_ly(showscale = TRUE) %>%
  add_surface(z = ~z1, cmin = min(z1), cmax = max(z2), colorscale = list(c(0,1),c("rgb(255,112,184)","rgb(128,0,64)"))) %>%
  add_surface(z = ~z2, cmin = min(z1), cmax = max(z2), colorscale = list(c(0,1),c("rgb(107,184,214)","rgb(0,90,124)"))) %>%
  layout(title="SURFACE 1 + SURFACE 2\n(Distinct colorscales as defined)", scene = list(zaxis = list(range = c(min(z1),max(z2)))))

I couldn’t reproduce this result by using the colors key.

1 Like