title: Add text objects to legend in MATLAB plots
body: <p>I would like to add some text to a legend, regarding the text (i.e t1 variable) that I add in the figure.</p>
  
  <p>Here a simple example of the plot:</p>
  
  <pre><code>xa = [1 1 1 1 2 2 2 2 3 3 3 3 5 5 5 5];
  ya = rand(1,16);
  plot(xa, ya,'o', [0 5], [0.5 0.5],'k--')
  L = legend('values', 'average');
  for ii = 1:numel(xa)
      t1=text(xa(ii)+0.02, ya(ii), ['A_{' num2str(ii) '}'], ...
              'HorizontalAlignment','left', ...
              'VerticalAlignment','middle', ...
              'FontSize', 8);
  end
  </code></pre>
  
  <p>So, I would to have a third line in the legend that would say, for example, "A1 - A16". I read the documentation about <code>text</code> and I tried to use the <code>DisplayName</code> property, but I'm not able to make it works correctly.</p>