有谁知道如何设置初始帧ggplotly()
?
4个点的初始状态是1:4
,滑块加数字-10:10
。
假设我有这个动画情节:
library(ggplot2)
library(plotly)
add <- rep(seq(-10, 10, by = .5), each = 4)
x <- 1:4 + add
df <- data.frame(x = x, y = 1, add = add)
plot <- ggplot(df, aes(x, y)) +
geom_point(aes(frame = add),
col = rep(c("yellow", "green", "red", "blue"), length(unique(add))),
size = 5) +
theme(axis.line.x = element_line(),
panel.background = element_blank(), axis.title = element_blank(),
axis.text.y = element_blank(), axis.ticks.y = element_blank())
ggplotly(plot)
我希望情节从 x = 1:4(第 21 帧)而不是 x = -9:-6(第 1 帧)开始。
非常感谢!