First post so hopefully I've included everything.
I'm trying to do two things on the below charts:
- Change the legend title from z,z1,z2 to POS, ROD, INS
- Change the legend labels all to AOK and TUR
I've been trying to find the answer all day and so far nothing has worked.
My data is:
Year Area Percentage
<dbl> <fct> <dbl>
1 2008 AOKPOS 0.571
2 2008 AOKPOS 0.6
3 2008 AOKPOS 0.5
4 2008 AOKPOS 0.846
5 2008 AOKPOS 0.2
6 2008 AOKPOS 0.625
My code is:
plot1 <- ggplot() +
# blue plot
scale_x_continuous(name="", limits = c(2008, 2019),breaks = 0:2100)+ #No X axis title
scale_y_continuous(name = "",labels = scales::percent)+
theme(text = element_text(size=10))+
coord_cartesian(ylim = c(0,1))+
geom_smooth(data=Possum, aes(x=x, y=y, group=z, colour=z), size=1)
plot1
plot2 <- ggplot() +
# blue plot
scale_x_continuous(name="", limits = c(2008, 2019), breaks = 0:2100)+ #No X axis title
scale_y_continuous(name = "",labels = scales::percent)+
theme(text = element_text(size=10))+
coord_cartesian(ylim = c(0,1))+
geom_smooth(data=Rodent, aes(x=x1, y=y1, group=z1, colour=z1), size=1)
plot2
plot3 <- ggplot() +
# blue plot
scale_x_continuous(name="", limits = c(2008, 2019), breaks = 0:2100)+ #No X axis title
scale_y_continuous(name = "",labels = scales::percent)+
theme(text = element_text(size=10))+
coord_cartesian(ylim = c(0,1))+
geom_smooth(data=Insect, aes(x=x2, y=y2, group=z2, colour=z2), size=1)
plot3
grid.arrange(plot1, plot2, plot3, nrow=3)