I succeed to do this 2 ggplot graph.
The points of the graph on the right are datas who refere to the points of the curve on the left. SO this will be really great to combine this graph.
The y axes are the same, and x is just time convert to a numeric vector.
Do you know how can i do?
X <-
structure(list(Varietes = c("Abelastone", "Abelastone", "Abelastone",
"Abelastone", "Abelastone"), ligne.rep = c(1, 1, 1, 1, 1),
Pied = c(1, 3, 2, 6, 7), Date.floraison.mâle = c(7.29, 8.01, 8.02, 8.03,
8.04), Date.floraison.femelle = structure(c(1628553600, 1628640000,
1629158400, 1629849600, 1629158400), tzone = "UTC", class = c("POSIXct",
"POSIXt")), ASIi = c(12, 10, 15, 22, 13), Hauteur.des.pieds = c(230,
226, 228, 240, 233), Hauteur.des.soies = c(123, 116, 118, 124,
122), Cumulatif.mâle = c(1, 2, 3, 4, 5), date.mâle.graph = c(29,
32, 33, 34, 35), ASIi.floraisons.mâles = c(41, 42, 48, 56, 48
)), row.names = c(NA, -5L), na.action = structure(c(`6` = 6L,
`10` = 10L, `20` = 20L, `21` = 21L, `24` = 24L), class = "omit"),
class = c("tbl_df", "tbl", "data.frame"))
Code:
first<- ggplot( X, aes(x=date.mâle.graph, y=Cumulatif.mâle))+ geom_point()+ geom_line(size=1)+ggtitle("Floraison mâle en fonction du temps et de leurs ASIi") + xlab("Floraison mâle") + ylab("Individus de la variété")+ theme_minimal()+theme(
plot.title = element_text(color="black", size=14, face="plain"),
axis.title.x = element_text(color="black", size=16, face="plain"),
axis.title.y = element_text(color="black", size=16, face="plain"),
axis.text.x = element_text(face="bold", color="#993333", size=14, angle=0),
axis.text.y = element_text(face="bold", color="#993333", size=14, angle=0))
second<- ggplot( X, aes(x=ASIi.floraisons.mâles, y=Cumulatif.mâle))+ geom_point(shape=20, color="blue", size=4 )+ theme_minimal()
plot_grid(first, second)