Primeiro gráfico
par(mar = c(4.5, 4.5, 1, 1))
plot(clock, MRT_1F, type = "o", pch = 4, col = "black",
ylim = c(0, 520),
xlab = "Time between Things requests (seconds)",
ylab = "Response Time (sec.)")
lines(clock, MRT_3F, type = "o", pch = 16, col = "yellow")
lines(clock, MRT_5F, type = "o", pch = 1, col = "red")
lines(clock, MRT_10F, type = "o", pch = 2, col = "blue")
lines(clock, MRT_15F, type = "o", pch = 5, col = "purple")
lines(clock, MRT_sem_F, type = "o", pch = 4, col = "green", lty = 2)
legend("topright",
legend = c("1 Fog", "3 Fogs", "5 Fogs", "10 Fogs", "15 Fogs", "w/o Fog"),
col = c("black", "yellow", "red", "blue", "purple", "green"),
pch = c(4, 16, 1, 2, 5, 4),
lty = c(1, 1, 1, 1, 1, 2),
cex = 0.8)

Segundo gráfico
cores <- c("#E6E6E6", "#666666")
configs <- list(
list(dados = MRT_1F, legenda = "1 Fog"),
list(dados = MRT_3F, legenda = "3 Fogs"),
list(dados = MRT_5F, legenda = "5 Fogs"),
list(dados = MRT_10F, legenda = "10 Fogs"),
list(dados = MRT_15F, legenda = "15 Fogs")
)
par(mar = c(4.5, 4.5, 1, 1))
for (cfg in configs) {
barplot(rbind(MRT_sem_F, cfg$dados), beside = TRUE, log = "y",
col = cores, names.arg = clock,
xlab = "Time between Things requests",
ylab = "Response time (s)",
legend.text = c("w/o Fog", cfg$legenda),
args.legend = list(x = "topright", cex = 0.7))
}





layout(1)