Just add a dash to the line specification to connect the dots.
Instead of
plot(tau_invp(n), T_delayp(n), 'r.')
Add a dash as shown below
plot(tau_invp(n), T_delayp(n), 'r.-')
After plotting, use the legend function to add a legend to your graph. Just input names for each line in the order in which they were plotted and they will appear in the legend.
plot(1:10, rand(1,10), 'r.-')
legend('myline')