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
Hello,
I am trying to make an epidemic plot of the COVID pandemic using the core
plot function. I am looking at three countries and the countries are as
factors. The idea is to colour the entry by country, following this scheme:
```
df = data.frame(index = 1:10,
value = c(rnorm(10),
4 matches
Mail list logo