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

range in transition_time seems to fail #497

Open
bart1 opened this issue Mar 14, 2024 · 1 comment
Open

range in transition_time seems to fail #497

bart1 opened this issue Mar 14, 2024 · 1 comment

Comments

@bart1
Copy link

bart1 commented Mar 14, 2024

I try to animate movement trajectories using gganimate, to zoom in to a relevant (time) section I want to use the time range. However this seems to fail. Here is a small example on synthetic data. In this case I would expect the point to move between x coordinates 2 and 3 and not 1 and 2. Am I not using range correctly or is this a bug?

require(ggplot2)
#> Loading required package: ggplot2
require(gganimate)
#> Loading required package: gganimate
d<-data.frame(x=1:3,y=1:6*.3, t=as.double(7:9), id=gl(2,3))
p<-ggplot(d)+geom_point(aes(color=id, x=x,y=y)) +
  transition_time(t, range=c(8,9))+labs(title="{frame_time}")
animate(p, nframes=7, fps=2)

sessioninfo::package_info()
#>  package     * version  date (UTC) lib source
#>  cli           3.6.2    2023-12-11 [1] CRAN (R 4.3.2)
#>  colorspace    2.1-0    2023-01-23 [1] CRAN (R 4.3.1)
#>  crayon        1.5.2    2022-09-29 [1] CRAN (R 4.3.1)
#>  digest        0.6.33   2023-07-07 [1] CRAN (R 4.3.1)
#>  dplyr         1.1.3    2023-09-03 [1] CRAN (R 4.3.1)
#>  evaluate      0.21     2023-05-05 [1] CRAN (R 4.3.1)
#>  fansi         1.0.6    2023-12-08 [1] CRAN (R 4.3.3)
#>  farver        2.1.1    2022-07-06 [1] CRAN (R 4.3.1)
#>  fastmap       1.1.1    2023-02-24 [1] CRAN (R 4.3.1)
#>  fs            1.6.3    2023-07-20 [1] CRAN (R 4.3.1)
#>  generics      0.1.3    2022-07-05 [1] CRAN (R 4.3.1)
#>  gganimate   * 1.0.9    2024-02-27 [1] CRAN (R 4.3.3)
#>  ggplot2     * 3.5.0    2024-02-23 [1] CRAN (R 4.3.3)
#>  gifski        1.12.0-2 2023-08-12 [1] CRAN (R 4.3.2)
#>  glue          1.7.0    2024-01-09 [1] CRAN (R 4.3.2)
#>  gtable        0.3.4    2023-08-21 [1] CRAN (R 4.3.1)
#>  hms           1.1.3    2023-03-21 [1] CRAN (R 4.3.1)
#>  htmltools     0.5.5    2023-03-23 [1] CRAN (R 4.3.1)
#>  knitr         1.43     2023-05-25 [1] CRAN (R 4.3.1)
#>  labeling      0.4.3    2023-08-29 [1] CRAN (R 4.3.1)
#>  lifecycle     1.0.4    2023-11-07 [1] CRAN (R 4.3.3)
#>  magrittr      2.0.3    2022-03-30 [1] CRAN (R 4.3.1)
#>  munsell       0.5.0    2018-06-12 [1] CRAN (R 4.3.1)
#>  pillar        1.9.0    2023-03-22 [1] CRAN (R 4.3.1)
#>  pkgconfig     2.0.3    2019-09-22 [1] CRAN (R 4.3.1)
#>  prettyunits   1.2.0    2023-09-24 [1] CRAN (R 4.3.3)
#>  progress      1.2.3    2023-12-06 [1] CRAN (R 4.3.3)
#>  purrr         1.0.1    2023-01-10 [1] CRAN (R 4.3.1)
#>  R.cache       0.16.0   2022-07-21 [1] CRAN (R 4.3.1)
#>  R.methodsS3   1.8.2    2022-06-13 [1] CRAN (R 4.3.1)
#>  R.oo          1.25.0   2022-06-12 [1] CRAN (R 4.3.1)
#>  R.utils       2.12.2   2022-11-11 [1] CRAN (R 4.3.1)
#>  R6            2.5.1    2021-08-19 [1] CRAN (R 4.3.1)
#>  reprex        2.0.2    2022-08-17 [1] CRAN (R 4.3.1)
#>  rlang         1.1.3    2024-01-10 [1] CRAN (R 4.3.2)
#>  rmarkdown     2.23     2023-07-01 [1] CRAN (R 4.3.1)
#>  rstudioapi    0.15.0   2023-07-07 [1] CRAN (R 4.3.1)
#>  scales        1.3.0    2023-11-28 [1] CRAN (R 4.3.3)
#>  sessioninfo   1.2.2    2021-12-06 [1] CRAN (R 4.3.1)
#>  stringi       1.8.3    2023-12-11 [1] CRAN (R 4.3.3)
#>  styler        1.10.1   2023-06-05 [1] CRAN (R 4.3.1)
#>  tibble        3.2.1    2023-03-20 [1] CRAN (R 4.3.1)
#>  tidyselect    1.2.0    2022-10-10 [1] CRAN (R 4.3.1)
#>  tweenr        2.0.3    2024-02-26 [1] CRAN (R 4.3.3)
#>  utf8          1.2.4    2023-10-22 [1] CRAN (R 4.3.3)
#>  vctrs         0.6.5    2023-12-01 [1] CRAN (R 4.3.3)
#>  withr         3.0.0    2024-01-16 [1] CRAN (R 4.3.3)
#>  xfun          0.39     2023-04-20 [1] CRAN (R 4.3.1)
#>  yaml          2.3.7    2023-01-23 [1] CRAN (R 4.3.1)
#> 
#>  [1] /home/bart/R/x86_64-pc-linux-gnu-library/4.3
#>  [2] /usr/local/lib/R/site-library
#>  [3] /usr/lib/R/site-library
#>  [4] /usr/lib/R/library

Created on 2024-03-14 with reprex v2.0.2

@bart1
Copy link
Author

bart1 commented Mar 14, 2024

Trying old versions of the package the problem seems to be introduced in 1.0.8

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

1 participant