I am trying to colour my plot to be the image below with a colour scheme across Transect locations but also between the two different Communities: All species and Without Clidemia hirta.
I would like a pattern for one of the communities, but I can't figure out a way to do this in ggplot2 (the image below was manipulated after exporting). I have managed to apply an alpha colour to differentiate the two communities, and although this looked good on the graph, you could not see a difference between the two in the legend.
Plot I want to achieve
My data:
Transect.location = c("Forest disturbed", "Forest-oil palm edge", "Forest less disturbed", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Forest less disturbed", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Forest less disturbed", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Forest less disturbed", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Forest less disturbed", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Forest less disturbed", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Forest disturbed", "Forest disturbed", "Forest-oil palm edge", "Forest-oil palm edge", "Forest-oil palm edge", "Oil palm", "Oil palm", "Forest disturbed", "Oil palm", "Forest-oil palm edge", "Oil palm", "Forest-oil palm edge", "Oil palm", "Oil palm", "Forest-oil palm edge", "Forest disturbed", "Forest-oil palm edge", "Forest-oil palm edge", "Oil palm", "Forest-oil palm edge", "Oil palm", "Oil palm", "Forest disturbed", "Forest-oil palm edge", "Forest-oil palm edge", "Oil palm", "Oil palm", "Forest disturbed", "Oil palm", "Forest-oil palm edge", "Forest disturbed")
woodiness = c(1, 0.605128205, 1, 0.230538922, 1, 0.891891892, 1, 0.169014085, 1, 0.417624521, 1, 0.234513274, 1, 0.317073171, 1, 0.597484277, 0.695238095, 0.236151603, 0.064516129, 1, 0.667655786, 1, 0.285714286, 1, 0.96, 1, 0.974025974, 0.732142857, 0.293929712, 1, 0.346153846, 0.127659574, 0.613793103, 0.2265625, 0.210045662, 0.025, 0.196581197, 0.254385965, 0, 0.05952381, 0.330434783, 0.051660517, 0.056179775, 0.126760563, 1, 0.571428571, 0, 0, 0.126213592, 0.116666667, 0.015384615, 0.53968254, 0.733333333, 0.417085427, 0.092307692, 0.041666667, 0.482758621, 0.018181818, 0.169172932, 0)
Community = c("All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "All species", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta", "Without Clidemia hirta")
data = data.frame(Transect.location, woodiness, Community)
data$Transect.location<-factor(data$Transect.location, levels=c("Oil palm", "Forest-oil palm edge", "Forest disturbed", "Forest less disturbed"))
My code:
ggplot(data, aes(x = Transect.location, y = woodiness, alpha = factor(Community), fill = factor(Transect.location))) +
geom_boxplot(aes(fill = Transect.location))+
scale_fill_manual(name = "Transect.location", values = c("#FDECCD", "#BAE4B3", "#329A55", "#075507"))+
scale_alpha_manual(name = "Community", values = c(1, 0.5))