title: MATLAB: how to add custom legend to any plot
body: <p>How do I add custom legend to any plot?<br>
  For example:  </p>
  
  <pre><code>figure(200)
  plot(t1:k,Pexact(t1:k,1),'-xk');
  plot(t1:k,xh(1,t1:k),'-sr');
  </code></pre>
  
  <p>and then I want use the same codes to add plots</p>
  
  <pre><code>hold on plot(t1:k,xh(1,t1:k),'-sb');
  </code></pre>
  
  <p>and then I want to add a legend for all three plots </p>