title: How do I make a Matlab plot fill the whole page?
body: <p>I want to make a plot in Matlab which is twice as tall as it is long. I tried following the advice of <a href="https://stackoverflow.com/questions/5183047/setting-graph-figure-size">this question</a> using <code>Position</code> and <code>PaperPositionMode</code>, like so:</p>
  
  <pre><code>figure
  set(gcf,'PaperPositionMode','auto');
  set(gcf, 'Position', [0 0 100 200]);
  barh(1:20);
  print('test', '-dpng');
  </code></pre>
  
  <p>Annoyingly, this resizes the paper size but not the plot, as below. </p>
  
  <p><img src="https://i.stack.imgur.com/d6dLV.png" alt="a large plot on undersized paper"></p>
  
  <p>Is there any way to make a graph with specified width and height? I'm running this on a headless server so clicking and dragging, or any other GUI-specific solutions, aren't an option. Obviously I don't actually want a 100x200 plot, I just wanted to make the figure small enough to fit nicely into the question.</p>