First, what you did with plot
is not a histogram. It is just the plot of your data. You can try something like this:
> curve_17 <- read.table("C:/.../samp_17.txt")
> curve_25 <- read.table("C:/.../samp_25.txt")
> curve_30 <- read.table("C:/.../samp_30.txt")
>
> plot(curve_17[2:50,],type="l",ylim=range(curve_17[2:50,],curve_25[2:50,],curve_30[2:50,]))
> points(curve_25[2:50,],type="l",col="blue",lwd=2)
> points(curve_30[2:50,],type="l",col="red",lwd=3)
> legend("topright",col=c("black","blue","red"),legend=c("curve_17","curve_25","curve_17"),lty=rep(1,3),lwd=1:3)
>