title: Avoid text overlap in MATLAB figures
body: <p>When inserting text into MATLAB figures programmatically using <code>text(x,y,'label')</code>, I often find that the text blocks overlap, making them unreadable. I was wondering if there was any automated way to offset the text blocks so they wouldn't overlap. For instance, if I added 3 labels with top-left alignment at the points (0,0), (0.01,0), and (0.02,0), I'd want them to reposition themselves like:</p>
  
  <pre><code>. . .
  label1
    label2
      label3
  </code></pre>
  
  <p>whereas currently they look like:</p>
  
  <pre><code>. . .
  la~~~~~~l3
  </code></pre>
  
  <p>where the squiggles are unreadable due to the overlap.</p>
  
  <p>If there's not already a way to do this, I could roll my own algorithm/heuristic for the task, but is there a way to query a figure (or the <code>gcf</code> handle) for the bounding boxes of all existing text boxes on it? So then I can call this every time I want to place a label?</p>
  
  <p>Thanks!</p>