You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am not able to get all the 3D surface plots in one picture with below code. This same code worked fine with type="box" and "histogram".
The code below only generates one plot, but if you then if you check "plots" variable it does have 3 separate plots.
Can you suggest if I am doing something wrong here?
df <- read.csv('https://raw.githubusercontent.com/plotly/datasets/master/3d-line1.csv')
lst <- levels(factor(df$color))
plots <- list()
for(i in 1:nlevels(factor(df$color))){
subdf <- dplyr::filter(df, color == lst[i])
dens = akima::interp(subdf$x, subdf$y, subdf$z, duplicate = "mean")
p <- plot_ly(x = dens$x, y = dens$y, z = dens$z, colors = c("blue","red"), type = "surface)
plots[[i]] <- p
}
subplot(plots, nrows = 2)
One another note, I am doing subplots for type="contour" and it makes the plots but the legend seems to get overlapped. Can each subplot have its own legends?
For example, with same dataset above, here is what I get...
df <- read.csv('https://raw.githubusercontent.com/plotly/datasets/master/3d-line1.csv')
lst <- levels(factor(df$color))
plots <- list()
for(i in 1:nlevels(factor(df$color))){
subdf <- dplyr::filter(df, color == lst[i])
dens = akima::interp(subdf$x, subdf$y, subdf$z, duplicate = "mean")
p <- plot_ly(x = dens$x, y = dens$y, z = dens$z, colors = c("blue","red"), type = "contour") #%>% add_surface()
plots[[i]] <- p
}
subplot(plots, nrows = 2)
The text was updated successfully, but these errors were encountered:
@cpsievert
Hi Carson,
Thanks for checking it out .
I found this out today that scene argument can be passed inside plotly object and laos I have to update my Plotly to 4.5.6.9000.
Upgrading did fix the problem. But weird with everything matched to exact version, it works fine on my Mac but doesnt work on my work Windows laptop.
Also on the mac, it seem to only plot all the subplots in one row even with nrows = 2.
Any idea if I am still missing something or if this could be a possible bug.
Hi,
I am not able to get all the 3D surface plots in one picture with below code. This same code worked fine with type="box" and "histogram".
The code below only generates one plot, but if you then if you check "plots" variable it does have 3 separate plots.
I found the plotly with Python can do this but there is no R page for this. (https://plot.ly/python/3d-subplots)
Can you suggest if I am doing something wrong here?
One another note, I am doing subplots for type="contour" and it makes the plots but the legend seems to get overlapped. Can each subplot have its own legends?
For example, with same dataset above, here is what I get...
The text was updated successfully, but these errors were encountered: