Hello,
This is probably off-topic since you have chosen base graphics but this
is much easier with ggplot.
library(ggplot2)
ggplot(df, aes(Index, Incidence, colour = Country)) +
geom_line() +
scale_colour_manual(values = c("red", "black", "blue")) +
theme_minimal()
Hope this helps,
Hi Luigi,
This is pretty easy using "plot" and "lines":
# assume your example data
plot(g1,col ="red",type = "l", lwd = 2,
xlab = "Days since start", ylab = "Count of infections",
main = "Daily cases of COVID-19")
lines(g2,col="black", lwd = 2)
lines(g3,col="blue", lwd = 2)
text(c(15,80,
Hi Luigi,
the problem is not the first graph vs the second graph. The first
graph would also show the same effect if you added type='l' to the
plot command.
There are various ways to approach this. A quick search turned up the
following which gives you different options.
https://stackoverflow.com/q
3 matches
Mail list logo