Created
November 6, 2017 20:09
-
-
Save daattali/e7286b6db4efc48d9f67f584c5a3ee69 to your computer and use it in GitHub Desktop.
plotly toWebGL issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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