library(ggplot2)
library(data.table)
Markov = data.table(
Printemps = c(0.3864, 0.57244352, 0.70207864, 0.7924084, 0.855350173, 0.899208, 0.929768135, 0.951062436, 0.965900306, 0.976239333, 0.983443567, 0.988463478, 0.991961351, 0.99439867, 0.996096993),
Ete = c(0.3765, 0.53829825, 0.658109854, 0.746830347, 0.812527872, 0.861176889, 0.897201486, 0.923877701, 0.943631437, 0.958259079, 0.969090848, 0.977111773, 0.983051268, 0.987449464, 0.990706328),
Automne = c(0.6853,0.82870879,0.906766194,0.94925284,0.972378321,0.98496552,0.991816732,0.995545847,0.997575605,0.998680402,0.999281743,0.999609053,0.999787207,0.999884177,0.999936958),
Hiver = c(0.4012,0.57820528,0.702887799,0.790714166,0.852579058, 0.896156689,0.926852772,0.948475092,0.963705855,0.974434404,0.981991594,0.987314879,0.991064601,0.993705905, 0.995566439)
)
Topil = data.table(
Hiver = c(0.4012,0.64143856,0.78529341,0.871433694,0.923014496,0.95390108,0.972395967,0.983470705,0.990102258,0.994073232,0.996451051,0.99787489,0.998727484,0.999238017,0.999543725),
Ete = c(0.3765,0.61124775, 0.757612972, 0.848871688, 0.905771498, 0.941248529, 0.963368458, 0.977160233, 0.985759405,0.991120989,0.994463937,0.996548265,0.997847843,0.99865813,0.999163344),
Automne = c(0.4557,0.70373751,0.838744327,0.912228537,0.952225993,0.973996608,0.985846354,0.99229617,0.995806805,0.997717644,0.998757714,0.999323824,0.999631957,0.999799674,0.999890963),
Printemps = c(0.3864,0.51446976,0.661682529,0.764260386,0.835736637,0.885541289,0.92024517,0.944426834,0.61276618,0.973017548,0.981198627,0.986899203,0.990871365,0.993639167,0.995567772)
)
#Edit the values to best place the labels
labels = data.table(
label = c("Printemps", "Ete", "Automne", "Hiver"),
x = c(4, 7, 7, 5),
y = c(0.7924084, 0.88, 1.01, 0.852579058)
)
#Transform Markov
Markov[,x:=.I]
Markov=melt(Markov,id.var="x",variable.name="Markov",value.name="y")
print(Markov,topn = 6)
#Transform Topil
Topil[,x:=.I]
Topil=melt(Topil,id.var="x",variable.name="Topil",value.name="y")
print(Topil,topn = 6)
#Plot
ggplot() +
#Markov lines
Markov[,geom_line(data = .SD, aes(x = x, y = y, color = Markov), inherit.aes = F),] +
labels[,geom_text(data = .SD, aes(x = x, y = y, label = label, color = label), inherit.aes = F),] +
#Topil points
Topil[,geom_point(data = .SD, aes(x = x, y = y, shape = Topil, color = Topil), inherit.aes = F),] +
guides(color = FALSE) + #hide color legend
labs(x = "X -axis", y = "Y-axis", title = "Tile") +
theme( #Edit the background and lines
panel.background = element_rect(fill = "white"),
panel.grid.major = element_line(size = 0.5, linetype = 'solid', colour = "gray"),
panel.grid.minor = element_line(size = 0.5, linetype = 'dotted', colour = "gray"))