Skip to content

animate: allow adapting range to each layer - #1909

Merged
rhijmans merged 2 commits into
rspatial:masterfrom
AMBarbosa:patch-30
Oct 2, 2025
Merged

rhijmans merged 2 commits into
rspatial:masterfrom
AMBarbosa:patch-30

Conversation

@AMBarbosa

Copy link
Copy Markdown
Contributor

...rather than the minmax of all layers combined. Otherwise, the range is not appropriate for layers that vary within very different scales, e.g. WorldClim.

...rather than the minmax of all layers combined. Otherwise, the range is not appropriate for layers that vary within very different scales, e.g. WorldClim.
@rhijmans

Copy link
Copy Markdown
Member

I do not think that is what the default should be --- in time-series animations you should have a single legend. What you propose could be an options. Perhaps invoked by using argument range=NA. Also, it is better to use minmax(x, compute=TRUE) than (expensive) global(x, "range")

@AMBarbosa

Copy link
Copy Markdown
Contributor Author

Agreed! And thanks for the minmax tip!

@AMBarbosa AMBarbosa changed the title animate: adapt default range to each layer animate: allow adapting range to each layer Oct 2, 2025
@rhijmans
rhijmans merged commit ed0a349 into rspatial:master Oct 2, 2025
6 checks passed
rhijmans added a commit that referenced this pull request Oct 2, 2025
@rhijmans

rhijmans commented Oct 2, 2025

Copy link
Copy Markdown
Member

Thanks; I simplified a bit and set the default to "range=NULL" because that is what terra::plot has.

@AMBarbosa
AMBarbosa deleted the patch-30 branch October 2, 2025 17:24
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.

2 participants