Skip to content

Instantly share code, notes, and snippets.

@daattali
Created Nov 6, 2017
Embed
What would you like to do?
plotly toWebGL issues
library(ggplot2)
library(plotly)
data <- data.frame(x = rnorm(20), y = runif(20), z = letters[1:20])
p <- ggplot(data, aes(x = x, y = y)) +
geom_smooth(method='lm') +
geom_point(aes(text = z)) +
scale_x_continuous(limits = c(0, 5)) +
annotate("text", label = "foo", x=1, y=1)
ggplotly(p, tooltip = "text") # looks good
toWebGL(ggplotly(p, tooltip = "text")) # y axis cut off, no points show up (because the scale cuts off >0 points), the text annotation became a single point, the shaded confidence interval disappeared BUT you can still hover on its outline , it's like a ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment