I'm working on the flowering of maize. So here is my data.
X2 <- structure(list(Cumulatif.mâle = c(1, 1, 2, 2, 3, 3, 4, 4, 5, 5), name = c("date.mâle.graph", "ASIi.floraisons.mâles", "date.mâle.graph", "ASIi.floraisons.mâles", "date.mâle.graph", "ASIi.floraisons.mâles", "date.mâle.graph", "ASIi.floraisons.mâles", "date.mâle.graph", "ASIi.floraisons.mâles"), value = c(29, 41, 32, 42, 33, 48, 34, 56, 35, 48)), row.names = c(NA, -10L), class = c("tbl_df", "tbl", "data.frame"))
ggplot(X2, aes(x = value, y = Cumulatif.mâle, color = name)) + geom_point()+ geom_line(
data = subset(X2, name == "date.mâle.graph"),
inherit.aes = TRUE,
size = 1) + ggtitle("Floraison mâle en fonction du temps et de leurs ASIi")+ xlab("Floraison mâle") + ylab("Individus de la variété") + xlim(range(pretty(X2$value))) + scale_color_manual(values = c("blue", "black")) + theme_minimal()+ theme(
plot.title = element_text(color="black", size=14, face="plain"),
axis.title = element_text(color="black", size=16, face="plain"),
axis.text = element_text(face="bold", color="#993333", size=14, angle=0))
This graph allow me to visualize the male flowering in function of time. But futhermore this graph allow me to visualize the ASIi (It's a data that interest me a lot) in function of the male flowering. You can see the graph below.
So here is my issue: I would like to visualize the ASIi, so the datas named "ASIi.floraisons.mâles" but with a point color code like this:
green: ASIi is inferior or egal at 3
orange: ASIi is comprised between 4 and 6
red: ASIi is comprised between 7 and 9
dark: ASIi is superior or egal at 10
This color code will be very really visual and really helpful in my work.
Do you have a idea how can I do?
