-
Notifications
You must be signed in to change notification settings - Fork 5
Compatibility ggplot2 4.0.0 #74
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
base: main
Are you sure you want to change the base?
Conversation
I think marquee has another problem related to the transition to S7. See https://github.com/teunbrand/ggplot2/blob/9f80c8c7b7bce220604737846956cfa1dbfeb0dc/revdep/problems.md#newly-broken-278 I am interested in the fix as I am in the same boat with my package ggpath, which also implements a
|
The revdep problem you point to should be solved by tidyverse/ggplot2#6506. |
But library(ggplot2)
library(marquee)
ggplot(mtcars) +
geom_point(aes(mpg, disp)) +
labs(title = "A {.red *marquee*} title\n* Look at this bullet list\n\n* great, huh?") +
theme_gray(base_size = 6) +
# element_marquee is S3
theme(title = element_marquee())
#> Error: `object` must be an <S7_object>, not a S3<element_marquee/element_text/element> Created on 2025-07-02 with reprex v2.1.1
|
Yeah, try installing the dev version again, the session info suggests you're a few commits behind |
Sorry, Teun. I am having compilation issues with the dev version but I have a reprex where I can show what I mean even with the CRAN version. I really don't want to be annoying but I need to understand what's going on. The first example works fine even with the current CRAN version. The second example combines I can also do the same thing in ggtext::element_markdown() and it also errors when doing axis.title library(ggplot2)
library(marquee)
# works as intended, even with current CRAN version
p <- ggplot(mtcars) +
geom_point(aes(mpg, disp)) +
labs(
title = "A **fat Title**",
y = "Red {.red disp}",
x = "Blue {.blue mpg}",
) +
theme_gray(base_size = 14)
p +
theme(
plot.title = element_marquee(),
axis.title.x = element_marquee(),
axis.title.y = element_marquee()
) # now combine axis.title.x and axis.title.y in axis.title
# S7 error related to element_marquee
p +
theme(
plot.title = element_marquee(),
axis.title = element_marquee()
)
#> Error: `object` must be an <S7_object>, not a S3<element_marquee/element_text/element> I can do the same thing with ggtext and library(ggplot2)
library(ggtext)
# works as intended, even with current CRAN version
p <- ggplot(mtcars) +
geom_point(aes(mpg, disp)) +
labs(
title = "A **fat Title**",
y = "*disp*",
x = "*mpg*",
) +
theme_gray(base_size = 14)
p +
theme(
plot.title = element_markdown(),
axis.title.x = element_markdown(),
axis.title.y = element_markdown()
) # S7 error related to element_marquee
p +
theme(
plot.title = element_markdown(),
axis.title = element_markdown()
)
#> Error: `object` must be an <S7_object>, not a S3<element_markdown/element_text/element> Created on 2025-07-02 with reprex v2.1.1
|
Sorry I meant the dev version of ggplot2. The examples you give all run fine with the current ggplot2 main branch, with the exception that the |
Oh lol. Will try latest ggplot2 dev version. Thanks for the help! |
This is just a reminder for @thomasp85. |
Hi Thomas,
The only issue I could find is related to tidyverse/ggplot2#6279, but it is not a hard fix.