I have a Design of 2 different Treatments (1)MIA: Poly_IC/Saline, 2) Ethanol:1/0) . I would like to assign different colors to Ethanol and a pattern to MIA. While the pattern worked out fine. I have trouble with the color.
Here is the code I used:
cort_v%>%
ggplot(aes(x=Groups, y=x, fill=Groups, pattern=Treatment1, color=Treatment2)) +
geom_boxplot()+
geom_boxplot_pattern(position = position_dodge(preserve = "single"),
color = "black",
pattern_fill = "black",
pattern_angle = 45,
pattern_density = 0.1,
pattern_spacing = 0.025,
pattern_key_scale_factor = 0.6) +
scale_pattern_manual(values = c(1 = "stripe", 0 = "none")) +
scale_color_manual(values = c("1" = "red", "0" = "white")) +
geom_point()+
theme_minimal()
In this code only the frame is colored and not filling the boxplot + it adds random colors Happy and grateful for any suggestions. Thanks a lot