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

when plotting raster, legend = FALSE doesn't work #738

Closed
gsapijaszko opened this issue Jul 30, 2022 · 3 comments
Closed

when plotting raster, legend = FALSE doesn't work #738

gsapijaszko opened this issue Jul 30, 2022 · 3 comments

Comments

@gsapijaszko
Copy link

gsapijaszko commented Jul 30, 2022

Hi Robert,

after upgrade I have realized that legend switch in plot isn't recognized:

devtools::install_version("terra", version = "1.6.3")
#> Downloading package from url: https://cloud.r-project.org/src/contrib/terra_1.6-3.tar.gz
#> Installing package into '/home/sapi/R/x86_64-pc-linux-gnu-library/4.1'
#> (as 'lib' is unspecified)
library(terra)
#> terra 1.6.3
utils::packageVersion("terra")
#> [1] '1.6.3'
r <- terra::rast(system.file("ex/elev.tif", package="terra"))
terra::plot(r, legend = FALSE)

Created on 2022-07-30 by the reprex package (v2.0.1)

After downgrading it to 1.5.xx, it works as expected:

devtools::install_version("terra", version = "1.5.34")
#> Downloading package from url: https://cloud.r-project.org/src/contrib/Archive/terra/terra_1.5-34.tar.gz
#> Installing package into '/home/sapi/R/x86_64-pc-linux-gnu-library/4.1'
#> (as 'lib' is unspecified)
library(terra)
#> terra 1.5.34
utils::packageVersion("terra")
#> [1] '1.5.34'
r <- terra::rast(system.file("ex/elev.tif", package="terra"))
terra::plot(r, legend = FALSE)

Created on 2022-07-30 by the reprex package (v2.0.1)

I got the same result with 1.6.5 from github

Regards,
Grzegorz

@gsapijaszko gsapijaszko changed the title when plotting raster legend = FALSE doesn't work when plotting raster, legend = FALSE doesn't work Jul 30, 2022
@rhijmans
Copy link
Member

rhijmans commented Jul 31, 2022

Thank you very much for reporting this. It works again.
There is a work-around with the current version:

plot(r, 1, legend = FALSE)

@gsapijaszko
Copy link
Author

Thanks :).

@wiesehahn
Copy link

I am using terra 1.7.18 and get the same error

plot(r, 1, legend = FALSE) works
plot(r, legend = FALSE) does not

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

3 participants