#R code:
library(ggplot2)
C1=0.50
C2=0.25
C3=0.10
do=0.25
eq = function(t) {do*(1-C1)^t}
eq2 = function(t) {do*(1-C2)^t}
eq3= function(t) {do*(1-C3)^t}

plot.range1 &lt;- data.frame(x=c(0, 20), N = factor(1))
plot.range2 &lt;- data.frame(x=c(0, 20), N = factor(2))
plot.range3 &lt;- data.frame(x=c(0, 20), N = factor(3))
#https://stackoverflow.com/questions/16796961/plotting-multiple-functions-and-adding-legends-for-them-in-ggplot2
a &lt;- ggplot(NULL, aes(x=x, colour=N)) +
  stat_function(data = plot.range1, fun = eq3) +
  stat_function(data = plot.range2, fun = eq2) +
  stat_function(data = plot.range3, fun = eq) +
  scale_colour_manual(values = c("red", "green", "blue"), labels = c(C3, C2, C1)) +
  ggtitle("Disminución de D en las generaciones") +
 l abs(y=paste("Valor de D"), x="generaciones") +
  #https://stackoverflow.com/questions/33779219/cannot-remove-grey-area-behind-legend- symbol-when-using-smooth
  theme(legend.text.align = 0, legend.key = element_rect(fill = NA, color = NA)) +
  #https://felixfan.github.io/ggplot2-remove-grid-background-margin/
  theme(panel.background = element_blank(), axis.line = element_line(colour = 
"black"),panel.grid.major = element_line(colour="gray"))
svg("desequilibrio.svg",width=5, height=4)
a

 dev.off()
Own work
Smelgar