Does a surface created in plotly have to come from a rectangular df? Can that data frame have NA's in it? I have a data set of elevation coordinates that is rhombohedral with NA's filling the space to make it rectangular. I would like to do something like this:
Exemplary Goal
library(plotly)
# volcano is a numeric matrix that ships with R
fig <- plot_ly(z = ~volcano)
fig <- fig %>% add_surface()
fig
I tried removing my Y column (basin_data_plotly[ , -1]) but that did not seem to work. Any advice on how to make the something like the fallowing work?
Starting Point
library(plotly)
# volcano is a numeric matrix that ships with R
fig <- plot_ly(z = basin_data_plotly)
fig <- fig %>% add_surface()
fig
Hi @bryanrt,
Thanks for providing your data to play with. I couldn't get plotly to work unless I removed the "Y" column and converted to a matrix. It seems that NAs are not a problem.
Thank you so much! I guess I was having issues with the way I was executing the plot_ly line as I had tried using the data after removing the Y column. Thank you kindly for the help!