I’m plotting 2 3D scenes side by side, and I would like them to share the same camera view. Is this possible in R? I found some Python discussions, but it’s not clear to me if the same can be done with the R interface.
Example code:
library(plotly)
df <- read.csv('https://raw.githubusercontent.com/plotly/datasets/master/vortex.csv')
fig1 <- plot_ly(scene='scene1',showscale=FALSE,
df,
type="cone",
x= ~x,
y= ~y,
z= ~z,
u= ~u,
v= ~v,
w= ~w,
sizemode= 'absolute',
sizeref= 40
)
fig2 <- plot_ly(scene='scene2',showscale=FALSE,
df,
type="cone",
x= ~x,
y= ~y,
z= ~z,
u= ~v,
v= ~u,
w= ~w,
sizemode= 'absolute',
sizeref= 40
)
subplot(fig1, fig2) |>
layout(scene1 = list(domain=list(x=c(0,0.5),y=c(0,1)),
aspectmode='cube'),
scene2 = list(domain=list(x=c(0.5,1),y=c(0,1)),
aspectmode='cube'))