Closed gregleleu closed 5 years ago
Hi Greg, thanks for describing your issue.
I'm still a bit hazy on exactly what you're experiencing. I don't think I could reproduce this issue myself based on your description.
Could I ask you to please break it down into a set of steps, ideally with a minimal snippet of code that I can run in my own RStudio? I'd like to follow along and see if I get the same behavior on my machine.
Thanks!
Sure,
Super simple example:
library(ggplot2)
library(ggrepel)
library(dplyr)
ggdata <- diamonds %>%
group_by(cut) %>%
summarise_at(vars(depth, table), mean)
ggdata %>%
ggplot() +
geom_point(aes(x = depth, y = table)) +
geom_text_repel(aes(x = depth, y = table, label = cut))
Works fine in the normal chunk output:
But completely disappears in the new window (I think they're called satellite windows):
In latest Rstudio daily (1.2.1114) but it's been like that always. Session info:
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.7.8 ggrepel_0.8.0.9000 ggplot2_3.1.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 rstudioapi_0.8 knitr_1.20 bindr_0.1.1 magrittr_1.5 tidyselect_0.2.5
[7] munsell_0.5.0 colorspace_1.3-2 R6_2.3.0 rlang_0.3.0.1 plyr_1.8.4 tools_3.5.1
[13] grid_3.5.1 gtable_0.2.0 withr_2.1.2 lazyeval_0.2.1 assertthat_0.2.0 tibble_1.4.2
[19] crayon_1.3.4 bindrcpp_0.2.2 purrr_0.2.5 glue_1.3.0 labeling_0.3 compiler_3.5.1
[25] pillar_1.3.0 scales_1.0.0 pkgconfig_2.0.2
I am seeing this issue as well. For me, the redraw occurs after I restart my RStudio session and open up an old RMD. All the ggrepel labels will be gone from my plots.
I have the same issue woking with mark-down. The ggrepel labels are shown correctly in the graphic directly implemented in the markdown script but when I click "show in new window" at the upper right side off the graph (eg to look at it a bigger size), the labels disappear.
I was able to reproduce the issue on my laptop:
https://vimeo.com/318265708#t=52s
It seems everything works as expected, except for Show in New Window
We should contact RStudio developers and ask if they have any ideas about why this is happening.
It seems this is a bug in RStudio, not ggrepel.
Summary
I use Rmd notebooks in R studio, with plots displayed in the chunk output. Rstudio lets you open these outputs in a new window (e.g. to have a bigger view). When opening a new window with the plot labels disappear, I guess they are not redrawn?
Version information
Using ggrepel 0.8.0.9C, but it's been like that for ever.
Here is the output from
sessionInfo()
in my R session: