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

Fix guides with ggplot2 3.5.0 #493

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Fix guides with ggplot2 3.5.0 #493

merged 2 commits into from
Feb 19, 2024

Conversation

teunbrand
Copy link
Contributor

This PR aims to fix #489.

Demo that the guides are present:

devtools::load_all("~/packages/test/gganimate/")
#> ℹ Loading gganimate
#> Loading required package: ggplot2

ggplot(mtcars, aes(factor(cyl), mpg)) + 
  geom_boxplot(aes(fill = factor(cyl))) + 
  transition_states(
    gear,
    transition_length = 2,
    state_length = 1
  ) +
  enter_fade() + 
  exit_shrink() +
  ease_aes('sine-in-out')

Created on 2024-02-12 with reprex v2.1.0

I also found that that 'rolling limits' had to re-render the axis guides, so that is adressed here as well. Demo:

ggplot(economics, aes(as.numeric(date), unemploy)) +
  geom_line() +
  view_zoom_manual(
    0, 1, ease = "linear", wrap = FALSE,
    xmin = as.numeric(seq(as.Date("1970-01-01"), as.Date("2010-01-01"), length.out = 10)),
    xmax = as.numeric(seq(as.Date("1980-01-01"), as.Date("2020-01-01"), length.out = 10)),
    ymin = min(economics$unemploy),
    ymax = max(economics$unemploy)
  )

@thomasp85 thomasp85 merged commit 741e3b6 into thomasp85:main Feb 19, 2024
@thomasp85
Copy link
Owner

Thanks!

@teunbrand teunbrand deleted the guides branch February 19, 2024 14:19
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

Successfully merging this pull request may close these issues.

Legend not showing on animation
2 participants