Plot raster in grey scale #139
-
Given I'm trying to get the equivalent to I have tried:
|
Beta Was this translation helpful? Give feedback.
Answered by
dieghernan
Mar 6, 2024
Replies: 1 comment 6 replies
-
Why not just use library(terra)
#> terra 1.7.71
library(tidyterra)
library(ggplot2)
r <- rast(system.file("ex/logo.tif", package="terra"))
crs(r) <- NULL
plotRGB(r,1,1,1) ggplot() +
geom_spatraster_rgb(data = r, r =1, g=1, b=1) +
coord_sf() Created on 2024-03-05 with reprex v2.1.0 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just realized that
geom_spatraster_rgb()
interpolates by default (interpolate = TRUE
) whilegeom_spatraster()
don't (interpolate = FALSE
). Adjusting also the start and end color to black and white it is almost there: