title: Matlab setting print size of figure
body: <p>I know there are lots of questions on matlab printing questions, but I can't seem to figure this out.</p>
  
  <p>I want to print/save my figure at 17x23cm printed. With a resolution of 600dpi.</p>
  
  <p>I've tried this</p>
  
  <pre><code>set(gcf, 'Units', 'centimeters', 'Position', [0 0 17 23], 'PaperUnits', 'centimeters', 'PaperSize', [17 23]);
  </code></pre>
  
  <p>I'm then using the export_fig script and do either of the following</p>
  
  <pre><code>export_fig Test.pdf -pdf -transparent;
  export_fig Test.pdf -pdf -transparent -r600;
  </code></pre>
  
  <p>Either way, I get a figure that is ~14x19 cm.  And the resolution is only 100dpi.</p>
  
  <p>So I thought, okay 600dpi for a 17cm figure is ~4,000 pixels.  So lets just set the figure on screen to be that many pixels</p>
  
  <pre><code>set(gcf, 'Units', 'pixels', 'Position', [0 0 4000 5500]);
  </code></pre>
  
  <p>But that doesn't work. I assume because my monitor isn't big enough to support that many pixels, so it won't display. And I can't then save it because the figure doesn't even show up.</p>
  
  <p>I know I can resize after in gimp or illustrator or whatever. But I don't really want to.</p>
  
  <p>How do I export/save a pdf/eps graph at a specific print size (17cm) with a specific resolution (600dpi)? </p>