The graph does not display the legend until you call the legend function. Display the legend for the three lines.

legend([p1 p2 p3])

If you do not pass strings to the legend function, then legend uses the DisplayName properties as descriptions. If the DisplayName property does not have a value, then legend uses a default string of the form 'data1', 'data2', and so on.