View source: R/stat_signPattern.R
stat_signPattern | R Documentation |
stat_signPattern
stat_signPattern(
mapping = NULL,
data = NULL,
geom = "sf_pattern",
position = "identity",
show.legend = NA,
inherit.aes = TRUE,
...
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
geom |
Use to override the default connection between |
position |
A position adjustment to use on the data for this layer. This
can be used in various ways, including to prevent overplotting and
improving the display. The
|
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other parameters to |
ggpattern::geom_sf_pattern()
library(gg.layers)
library(ggplot2)
data("d_trendPerc")
d_mask <- mutate(d_trendPerc, mask = perc <= 0.99) # %>% as.data.frame()
# significant part; geom_sf_pattern still has bug unsolved.
ggplot() +
geom_raster(data = d_trendPerc, aes(x, y, fill = perc)) +
stat_signPattern(data = d_mask, aes(x, y, mask = mask),
fill = "transparent", color = "red",
pattern_density = 0.02)
# insignificant
ggplot() +
geom_raster(data = d_trendPerc, aes(x, y, fill = perc)) +
stat_signPattern(data = d_mask, aes(x, y, mask = !mask),
fill = "transparent", color = "red",
pattern_density = 0.02) #-> p
# Ipaper::write_fig(p, "temp.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.