x <- seq(0, 3, length=100) dfree<-c(1,1,10,10,1,10,10,1,15,20) names<-c("df1 = 1, df2 = 1","df1 = 10, df2 = 10", "df1 = 1, df2 = 10", "df1 = 10, df2 = 1", "df1 = 15, df2 = 20") colors<-c("blue", "red", "green", "orange", "brown") plot(x, df(x, df1 = dfree[1], df2 = dfree[2]), type="l", col=colors[1], lwd=2) for (i in seq(1,4)) lines(x, df(x, df1 = dfree[2*i+1], df2 = dfree[2*(i+1)]), type="l", col=colors[i+1], lwd=2 ) legend("topright", inset=.05, title="Distributions", names, lwd=2, lty=c(1, 1, 1, 1, 1), col=colors)