Skip to content

Instantly share code, notes, and snippets.

@daattali
Created November 6, 2017 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daattali/e7286b6db4efc48d9f67f584c5a3ee69 to your computer and use it in GitHub Desktop.
Save daattali/e7286b6db4efc48d9f67f584c5a3ee69 to your computer and use it in GitHub Desktop.
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