Skip to content

grey scale map #42

Answered by dieghernan
aloboa asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

So I see here two issues:

  1. First, scale_fill_grey() is a discrete scale, meant to be used with categorical variables. You would need to create a
    equivalent version with scale_fill_gradientn().
  2. It is not exactly clear to me the desired output on multispectral images, but I think this is tackled automatically by ggplot2 if you use facet_wrap().

See if this code helps:

library(tidyterra)
#> ── Attaching packages ─────────────────────────────────────── tidyterra 0.2.0 ──
#> 
#> Suppress this startup message by setting Sys.setenv(tidyterra.quiet = TRUE)
#> ✔ tibble 3.1.7     ✔ dplyr  1.0.9
#> ✔ tidyr  1.2.0
library(ggplot2)

file <- system.file("extdata/cyl_tile.tif", package = "tidyterra")

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dieghernan
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
📊 ggplot2 Issues related with the implementation of ggplot2 functionalities ❔ q&a Questions on the usage of tidyterra
3 participants
Converted from issue

This discussion was converted from issue #41 on September 21, 2022 07:04.