I have data i want to visualise using geom_tile. The data deal with references in text data from either Germany or Spain to other European countries.
Example data:
data<- tribble(
~Ref_country, ~Country, ~Share,
"ENG", "DE", 0.27,
"ENG", "ES", 0.24,
"ESP", "DE", 0.21,
"ESP", "ES", NA,
"GER", "DE", NA,
"GER", "ES", 0.13,
"FRA", "DE", 0.11,
"FRA", "ES", 0.18,
"ITA", "DE", 0.1,
"ITA", "ES", 0.17,
"POR", "DE", 0.03,
"POR", "ES", 0.07,
"RUS", "DE", 0.02,
"RUS", "ES", 0.02,
"NLD", "DE", 0.04,
"NLD", "ES", 0.01,
"BEL", "DE", 0.02,
"BEL", "ES", 0.03,
"SWE", "DE", 0.01,
"SWE", "ES", 0.01
)
Since i do not count references from a country to itself, GER-DE and ESP-ES are NA.
I plot this with ggplot, geom_tile and scale_fill_distiller:
x %>%
ggplot(., aes(x = Ref_country, y = Country, fill = Share)) +
geom_tile(color = "white", linewidth = 0.1) +
scale_fill_distiller(
type = "seq",
direction = 1,
palette = "Greys",
na.value = "white"
)
My question is: is there a way to distinguish the NAs not by color, but by pattern? Maybe through a creative application of ggpattern. Or alternatively, is it possible to add text ("NA") or a shape on top of the respective NA tiles? Since I will likely publish it in black and white, color is not a good distinguishing property.
Thanks in advance.
PS: As another alternative, can the color scale be restricted to greys that are clearly distinguishible from white?