I am trying to add a pattern from magick to only specific bars on my graph. I want to make it so that within the Chemical group of ASM and UNT that only the ASM bars have a checkerboard pattern and the UNT bars are just filled with the colors I have specified. My problems is that I can get the checkerboard pattern for the ASM bars, but then the UNT bars show up with the octagon pattern. Any suggestions for how to get this to work would be greatly appreciated.
here is my code:
ggplot(TQ2, aes(x = trt, y = Turf.Quality,
fill = trt)) +
geom_col_pattern(aes(
pattern_type = Chemical,
pattern_fill = Chemical),
pattern = 'magick' ,
pattern_fill = 'white',
colour = 'black',
pattern_scale = 2)+
scale_fill_manual(values=BWimg)+
scale_pattern_type_manual(values = c(ASM = "checkerboard", UNT = 'na'))+
facet_wrap(~Day)+
coord_cartesian(ylim = c(1,9)) +
scale_y_continuous(breaks = seq(1, 9, by=1))+
theme_classic()+
labs(x="", y = "Turf Quality") +
theme(axis.line = element_line(color="black"),
axis.ticks = element_line(color="black"),
panel.border = element_blank(),
axis.text.x = element_text(angle = 45, vjust = 0.85, hjust=0.85),
legend.position="none")
enter image description here: image the results from the code.
enter image description here Image of what I want the bar graphs to look like, but I want to be able to use magic to have access to more pattern types.