Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

labels do not appear in 0.9.5 #257

Closed
choiceMaster-ai opened this issue Feb 14, 2024 · 13 comments
Closed

labels do not appear in 0.9.5 #257

choiceMaster-ai opened this issue Feb 14, 2024 · 13 comments

Comments

@choiceMaster-ai
Copy link

Summary

Behaviour difference between identical GGPLOT code on Mac and Azure platform
Linux Ubuntu. The labels are produced on Mac, but not on Ubuntu.

Minimal code example

Here is the minimum amount of code needed to demonstrate the issue:

p <- p + ggrepel::geom_text_repel(aes(y=cumulative_percent, label = paste0(cumulative_percent,"%") ),
                                     size = 3.0,
                                     box.padding   = 0.0,
                                     point.padding = 0.0,
                                     segment.color = 'grey50',
                                     nudge_y = 10,
                                     direction = "both")

Here is an image of the output produced by the code:

image
image

Suggestions

Sorry, I have no idea how to resolve this

Version information

Version 0.9.4 on Mac , but 0.9.5 on Ubuntu

Here is the output from sessionInfo() in my R session:

R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8        LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8   
 [6] LC_MESSAGES=C.UTF-8    LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C           LC_TELEPHONE=C        
[11] LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] plumber_1.2.1     janitor_2.2.0     redux_1.1.4       stringr_1.5.1     lubridate_1.9.3   htmlwidgets_1.6.4
 [7] reactable_0.4.4   ggrepel_0.9.5     ggtext_0.1.2      ggplot2_3.4.4     formattable_0.2.1 knitr_1.45       
[13] uuid_1.2-0        dplyr_1.1.4       glue_1.7.0        pool_1.0.2        DBI_1.2.1        

loaded via a namespace (and not attached):
 [1] gtable_0.3.4      xfun_0.41         pingr_2.0.3       remotes_2.4.2.1   websocket_1.4.1   processx_3.8.3   
 [7] swagger_3.33.1    vctrs_0.6.5       tools_4.3.2       ps_1.7.6          generics_0.1.3    tibble_3.2.1     
[13] fansi_1.0.6       RSQLite_2.3.5     blob_1.2.4        pkgconfig_2.0.3   lifecycle_1.0.4   farver_2.1.1     
[19] compiler_4.3.2    textshaping_0.3.7 munsell_0.5.0     chromote_0.1.2    snakecase_0.11.1  httpuv_1.6.14    
[25] htmltools_0.5.7   later_1.3.2       pillar_1.9.0      ellipsis_0.3.2    cachem_1.0.8      webshot2_0.1.1   
[31] commonmark_1.9.1  tidyselect_1.2.0  digest_0.6.34     stringi_1.8.3     labeling_0.4.3    fastmap_1.1.1    
[37] grid_4.3.2        colorspace_2.1-0  cli_3.6.2         magrittr_2.0.3    base64enc_0.1-3   utf8_1.2.4       
[43] withr_3.0.0       scales_1.3.0      promises_1.2.1    bit64_4.0.5       timechange_0.3.0  rmarkdown_2.25   
[49] bit_4.0.5         ragg_1.2.7        webutils_1.2.0    memoise_2.0.1     evaluate_0.23     markdown_1.12    
[55] rlang_1.1.3       gridtext_0.1.5    Rcpp_1.0.12       xml2_1.3.6        rstudioapi_0.15.0 jsonlite_1.8.8   
[61] R6_2.5.1          systemfonts_1.0.5
Browse[1]> 
@slowkow
Copy link
Owner

slowkow commented Feb 15, 2024

Version 0.9.4 on Mac , but 0.9.5 on Ubuntu

If you are comparing two versions of ggrepel, then you should not necessarily expect the same output.

Next time, please also consider sharing a complete, minimal reproducible example. In your code, p is left undefined.

@choiceMaster-ai
Copy link
Author

Thank you for your response. I have now compared two versions of ggrepel::geom_label_repel on Mac to address the observed discrepancy in functionality. Specifically, version 9.5 does not function correctly on the Mac or Ubuntu, whereas version 9.4 on the Mac does, as evidenced by the accompanying images. Version 9.4 is not available on the Linux Ubuntu platform.

Regarding the comment about p being left undefined in the code, I'm uncertain of its significance or relevance to the reported bug. However, the main concern is the evidential inconsistency in functionality between the two versions.

The evidence presented below clearly illustrates the missing labels between versions 9.5 and 9.4 on the Mac.

I am unable to provide any additional evidence beyond what has already been provided. I encourage consideration of a regression test to further investigate and address the observed discrepancy.

Thank you for your attention to this matter.

Image shows version 9.5 output:
image
Image shows version 9.4 output:
image

@choiceMaster-ai
Copy link
Author

choiceMaster-ai commented Feb 15, 2024 via email

@aphalo
Copy link
Contributor

aphalo commented Feb 15, 2024

@choiceMaster-ai It is difficult to help you without code that we can actually run. A reprex does not need to use your confidential data. You can generate a similar plot with other data. How can we know before spending our unpaid free time dealing with your report that the problem is not related to the data you used? How can we be sure that there was nothing else different between the two R installations than the version of 'ggrepel'? For example, are you using exactly the same graphics device in both systems? Your report gives evidence that there is a problem in a specific system to which we do not have access. Without additional information, we are blindfolded in the search for a solution. We need additional help from you in the form of a reprex for dealing efficiently with your bug report. Hopefully, you will be able provide it. Thanks!

p.s.: I see in the first pair of plots that the labels are missing in a plot with a larger font size and truncated title. Have you tried zooming in and out? Does changing the size aesthetic affect the plotting of the labels? (With a reprex we could test this...)

@slowkow
Copy link
Owner

slowkow commented Feb 15, 2024

@choiceMaster-ai I have an inkling that your issue might be the same one as these issues:

Package developers always want complete, minimal, reproducible examples, because they want to run your code on their own machine to reproduce the problem.

My guess is that you might be able to work around this issue in a few different ways:

  • Use ggrepel 0.9.4 (or earlier versions that function the way you like).
  • Try the development version with devtools::install_github("slowkow/ggrepel") to get 0.9.5.9999, which might solve your issue as it did for the folks in the issues I mentioned above. In the future, when 0.9.6 is released, it should have the same functionality as 0.9.5.9999.

Each time I update ggrepel, I manually inspect the examples in the documentation and confirm that they look good. Since multiple users have reported the same issue with 0.9.5, I will consider adding one ore two examples to the documentation where we use Inf to position labels.

@slowkow slowkow changed the title Mac v Linux Ubuntu labels do not appear in 0.9.5 Feb 15, 2024
@choiceMaster-ai
Copy link
Author

choiceMaster-ai commented Feb 15, 2024 via email

@choiceMaster-ai
Copy link
Author

choiceMaster-ai commented Feb 16, 2024 via email

@slowkow
Copy link
Owner

slowkow commented Feb 16, 2024

Take your time.

I would recommend starting a new R session before installing new packages. I've seen these kinds of errors before for many different packages, and I always start a new session when I see them.

Also, you can try deleting the rdb file, starting a new R session, and then installing again. That should probably work. Good luck!

@choiceMaster-ai
Copy link
Author

choiceMaster-ai commented Feb 16, 2024 via email

@slowkow
Copy link
Owner

slowkow commented May 16, 2024

If you can share a reprex, then I can test if my new patch works for you. Please feel free to re-open this issue when you are ready to share a complete reproducible example for us to run.

@slowkow slowkow closed this as completed May 16, 2024
@choiceMaster-ai
Copy link
Author

choiceMaster-ai commented May 16, 2024 via email

@slowkow
Copy link
Owner

slowkow commented May 16, 2024

Feel free to try the latest code. I have a hunch it will work now.

@choiceMaster-ai
Copy link
Author

choiceMaster-ai commented May 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants