plotly.R
plotly.R copied to clipboard
Ordering of traces is still wrong
Following on from #225, here is an an example where ordering of traces is wrong
set.seed(12345)
df1 = data.frame(
x = seq(1, 200), y = 100 + cumsum(rnorm(200))
)
y.sparse = local({
i = sample(200, 10)
res = rep(0, 200)
res[i] = 120 + cumsum(rnorm(10))
res
})
df2 = data.frame(
x = seq(1, 200), y = y.sparse
)
p = ggplot(mapping = aes(x = x, y = y)) +
geom_area(data = df1) +
geom_col(data = df2, fill = "red")
p
ggplotly(p)

