-
Notifications
You must be signed in to change notification settings - Fork 24
Compatibility with ggplot2 4.0.0 #241
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
Conversation
|
This is just a simple reminder. |
Thanks @teunbrand !!! Will review and merge now! |
|
Thanks again for the nudge @teunbrand ! Mostly everything works perfectly with the new ggplot. As you mentioned, there are some items that shifted slightly because ggplot no longer reserves space for empty axis ticks. This led to minor changes in snapshot tests...no biggie. However, we are now seeing notes from the We'll need to investigate the new structure to see how we can avoid seeing these notes. library(ggsurvfit)
#> Loading required package: ggplot2
# get get a note about FILL and LINETYPE
survfit2(Surv(time, status) ~ surg, data = df_colon) %>%
ggsurvfit() +
add_legend_title()
#> Ignoring unknown labels:
#> • fill : "Time from Surgery to Treatment"
#> • linetype : "Time from Surgery to Treatment"# When the CI is present (and it does have a fill aestetic), the FILL note disappears
survfit2(Surv(time, status) ~ surg, data = df_colon) %>%
ggsurvfit() +
add_confidence_interval() +
add_legend_title()
#> Ignoring unknown labels:
#> • linetype : "Time from Surgery to Treatment"Created on 2025-07-23 with reprex v2.1.1 |
|
Yes I recall these messages being thrown around a lot in ggsurvfit. It's the reason why I've demoted them from warnings to messages. The messages inform folks when they have overspecified labels: when labels are present but the aesthetics are not. |
|
@teunbrand ! Thank you so much for the offer! I imagine your bandwidth is a bit low to support every package using ggolot, so @ShreyaSreeram27 and I will have a stab at it first and we'll let you know if we get stuck? |
ddsjoberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @teunbrand for the PR! Apologies for the delay on the review.
Also, thank you @ShreyaSreeram27 !


Hi Daniel and team!
I bring tidings about the new ggplot2 version we have been preparing.
I'm perplexed to report that we didn't find any issues in ggsurvfit, but we did find some in shared reverse dependencies that we traced to ggsurvfit.
In addition to the changes proposed herein, you might want to verify visual tests yourself.
From my scuffle with these, it seems like some spacing is affected because we no longer reserve space for empty axis ticks and some legend orders have changed (which we might expect due to the 'secret algorithm' mentioned in
?guide_legend).You can test your code with the development version of ggplot2 by installing it as follows:
(please note that tidyverse/ggplot2#6506 is intended to be merged in too, which will silence a series of warnings)
We aim to release the new ggplot2 version in about 2 weeks, and hope you can submit an update to CRAN around that time. Hopefully this will inform you in a timely manner.
Best wishes,
Teun
What changes are proposed in this pull request?
element_text2(), it conflicted with ggplot2's new element classesobject_namewith...in the arguments ofggplot_add()methods.If there is an GitHub issue associated with this pull request, please provide link.
There is no such issue.
Reviewer Checklist (if item does not apply, mark as complete)
renv::install()_pkgdown.ymlpkgdown::build_site(). Check the R console for errors, and review the rendered website.withr::with_envvar(list(CI = TRUE), code = devtools::test_coverage()). Begin in a fresh R session without any packages loaded.usethis::use_spell_check()runs with no spelling errors in documentationWhen the branch is ready to be merged into master:
NEWS.mdwith the changes from this pull request under the heading "# ggsurvfit (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (seeNEWS.mdfor examples).usethis::use_version(which = "dev")usethis::use_spell_check()again