title: Add legend outside of axes without rescaling in MATLAB
body: <p>I've got a GUI in MATLAB with a set of axes pre-placed. I'm using the location property of the  legend to place it to the right hand side of the axes. However, by doing this the axes get re-scaled so that the axes+legend take up the original width of the axes. Is there any way to circumvent the re-size?</p>
  <p>Example:</p>
  <pre><code>x=0:.1:10;
  y=sin(x);
  figure
  pos=get(gca,'position');
  pos(3)=.5; %#re-size axes to leave room for legend
  set(gca,'position',pos)
  plot(x,y)
  </code></pre>
  <p>So far I get:</p>
  <p><img src="https://i.stack.imgur.com/KAMj0.png" alt="alt text" /></p>
  <p>Place legend:</p>
  <pre><code>legend('sin(x)','location','eastoutside')
  </code></pre>
  <p>...aaaaand...</p>
  <p><img src="https://i.stack.imgur.com/CizZG.png" alt="alt text" /></p>
  <p>MATLAB squishes it all into the original axes space. Any way around this?</p>