<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248868</link>
    <title>MATLAB Central Newsreader - problems printing to file</title>
    <description>Feed for thread: problems printing to file</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 12 Apr 2009 14:21:30 -0400</pubDate>
      <title>problems printing to file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248868#642112</link>
      <author>ross</author>
      <description>Dear folks&lt;br&gt;
&lt;br&gt;
What I want to do is very straighforward - to transfer the plotted screen &lt;br&gt;
figures exactly as they appear on the screen to graphics files with the same &lt;br&gt;
pixel dimensions and the same colour depth as the screen figure, under program &lt;br&gt;
control.  Lossless compression is desirable, but not obligatory.&lt;br&gt;
&lt;br&gt;
In R2008b,  using the PRINT command, the -dbitmap driver is the only one that &lt;br&gt;
creates the correct sized file image, but it is not acceptable for shaded &lt;br&gt;
figures because it cuts the colour depth from 24bit to 8bit.&lt;br&gt;
The -dbmp, -dpng and -dtiff drivers retain 24bit colour but are completely &lt;br&gt;
useless because they save only a fraction of the screen figure (a rectangle &lt;br&gt;
based on the lower lefthand corner), and the size of this portion is not &lt;br&gt;
altered by any of the dpi settings.&lt;br&gt;
Fiddling with all the options that are allowable in the PRINT command doesn't &lt;br&gt;
seem to fix any of these problems.&lt;br&gt;
&lt;br&gt;
Interactive saving to file via the Figure menu bar DOES work.  Furthermore, if &lt;br&gt;
I change the File / Export Setup / Rendering / Resolution setting from 'auto' &lt;br&gt;
to 'screen', then further exporting of the same figure in m-code (PRINT &lt;br&gt;
command) now works correctly.  It continues to work correctly even if the &lt;br&gt;
setting is changed back to 'auto' !  However this is specific to each figure, &lt;br&gt;
and means that prior manual intervention is necessary for every figure.  I &lt;br&gt;
couldn't find any option for the PRINT command or in the various startup files &lt;br&gt;
that has the same effect.  The '-r0' option certainly doesn't.&lt;br&gt;
&lt;br&gt;
My programs usually generate multiple plots, from 5 to 30 at a time, so I need &lt;br&gt;
the figures to be saved under program control.  I don't see everyone else &lt;br&gt;
complaining about this:  so if it's something I'm doing wrong,  what the hell &lt;br&gt;
is it?&lt;br&gt;
Is there a command which can be used in m-files which has the same effect as &lt;br&gt;
setting Resolution to 'screen' in the Export Setup?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
Ross</description>
    </item>
    <item>
      <pubDate>Sun, 12 Apr 2009 19:56:01 -0400</pubDate>
      <title>Re: problems printing to file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248868#642154</link>
      <author>Jiro Doke</author>
      <description>Ross &amp;lt;ross@nospam.com&amp;gt; wrote in message &amp;lt;49e1f8e8@news.mel.dft.com.au&amp;gt;...&lt;br&gt;
&amp;gt; Dear folks&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What I want to do is very straighforward - to transfer the plotted screen &lt;br&gt;
&amp;gt; figures exactly as they appear on the screen to graphics files with the same &lt;br&gt;
&amp;gt; pixel dimensions and the same colour depth as the screen figure, under program &lt;br&gt;
&amp;gt; control.  Lossless compression is desirable, but not obligatory.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; In R2008b,  using the PRINT command, the -dbitmap driver is the only one that &lt;br&gt;
&amp;gt; creates the correct sized file image, but it is not acceptable for shaded &lt;br&gt;
&amp;gt; figures because it cuts the colour depth from 24bit to 8bit.&lt;br&gt;
&amp;gt; The -dbmp, -dpng and -dtiff drivers retain 24bit colour but are completely &lt;br&gt;
&amp;gt; useless because they save only a fraction of the screen figure (a rectangle &lt;br&gt;
&amp;gt; based on the lower lefthand corner), and the size of this portion is not &lt;br&gt;
&amp;gt; altered by any of the dpi settings.&lt;br&gt;
&amp;gt; Fiddling with all the options that are allowable in the PRINT command doesn't &lt;br&gt;
&amp;gt; seem to fix any of these problems.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Interactive saving to file via the Figure menu bar DOES work.  Furthermore, if &lt;br&gt;
&amp;gt; I change the File / Export Setup / Rendering / Resolution setting from 'auto' &lt;br&gt;
&amp;gt; to 'screen', then further exporting of the same figure in m-code (PRINT &lt;br&gt;
&amp;gt; command) now works correctly.  It continues to work correctly even if the &lt;br&gt;
&amp;gt; setting is changed back to 'auto' !  However this is specific to each figure, &lt;br&gt;
&amp;gt; and means that prior manual intervention is necessary for every figure.  I &lt;br&gt;
&amp;gt; couldn't find any option for the PRINT command or in the various startup files &lt;br&gt;
&amp;gt; that has the same effect.  The '-r0' option certainly doesn't.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; My programs usually generate multiple plots, from 5 to 30 at a time, so I need &lt;br&gt;
&amp;gt; the figures to be saved under program control.  I don't see everyone else &lt;br&gt;
&amp;gt; complaining about this:  so if it's something I'm doing wrong,  what the hell &lt;br&gt;
&amp;gt; is it?&lt;br&gt;
&amp;gt; Is there a command which can be used in m-files which has the same effect as &lt;br&gt;
&amp;gt; setting Resolution to 'screen' in the Export Setup?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&amp;gt; Ross&lt;br&gt;
&lt;br&gt;
Ross,&lt;br&gt;
&lt;br&gt;
To programmatically set the plot to save as you see on the screen, set the PaperPositionMode of the figure to &quot;auto&quot;.&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; surf(peaks)&lt;br&gt;
&amp;gt;&amp;gt; set(gcf,'PaperPositionMode','auto')&lt;br&gt;
&amp;gt;&amp;gt; print -dpng -r0 peaks.png&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure_props.html#PaperPositionMode&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure_props.html#PaperPositionMode&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 13 Apr 2009 06:42:31 -0400</pubDate>
      <title>Re: problems printing to file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248868#642215</link>
      <author>ross</author>
      <description>&quot;Jiro Doke&quot; &amp;lt;jiro.doke@mathworks.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;To programmatically set the plot to save as you see on the screen, set the &lt;br&gt;
&amp;gt;PaperPositionMode of the figure to &quot;auto&quot;.&lt;br&gt;
&amp;gt; ......&lt;br&gt;
&amp;gt;&amp;gt;&amp;gt; set(gcf,'PaperPositionMode','auto')&lt;br&gt;
&lt;br&gt;
Thanks Jiro.&lt;br&gt;
&lt;br&gt;
I should have guessed - it's this old problem of printer settings and concepts &lt;br&gt;
interfering where they are not relevant.&lt;br&gt;
Permit me a small rant - see if you agree with the following.&lt;br&gt;
&lt;br&gt;
It's high time that printer specific concepts such as dpi and paper position &lt;br&gt;
should be completely removed from the process of saving figures to graphics &lt;br&gt;
files. It's insane and always has been.  I've been programming since the early &lt;br&gt;
70s and these concepts have confusing people ever since then.  How many &lt;br&gt;
thousands of  times have you seen charts spewing out of the printer with the &lt;br&gt;
wrong size because someone got confused between the file resolution, the dpi &lt;br&gt;
and the printer settings?  Especially now, when the need for direct output to a &lt;br&gt;
printer is becoming rarer.  Programmers in general find the concept of &lt;br&gt;
specified pixel dimensions for the screen, and for the bitmapped graphics &lt;br&gt;
files, a very easy one to master.   One just interpolates to make one fit the &lt;br&gt;
other if necessary.  Dpi was a particularly iniquitous concept because it &lt;br&gt;
introduced complexity where none was needed.  At bottom, a bitmapped graphics &lt;br&gt;
file has a certain information density, and the printer in any given mode has &lt;br&gt;
another.  A single ratio is logically enough. In printer-oriented contexts, &lt;br&gt;
however, one was often drowning in ratios - dpi's for the file and printer, for &lt;br&gt;
a start, plus other settings - and in the end fudge factors often had to be &lt;br&gt;
applied before the output was what you'd expected.  Historically, it's been a &lt;br&gt;
shambles.  Vectorised graphics have their own language, but again it's far less &lt;br&gt;
confusing if file creation and printing from file are kept as separate &lt;br&gt;
activities. Many academics and researchers want to save their figures to a file &lt;br&gt;
in a suitable format, then interpolate, crop, overlay, edit, insert into &lt;br&gt;
journal articles or presentations, email to friends or publishers, etc.  ALL of &lt;br&gt;
this is done electronically, and printing simply doesn't come in to it.  All &lt;br&gt;
printer-specific settings,  eg,  margins, dpi, paper size and position, should &lt;br&gt;
be relegated to a special set of commands that are completely separate from &lt;br&gt;
those used for creating graphics files. If we modularised these activities, and &lt;br&gt;
the clarity and robustness of the command structure would improve considerably.&lt;br&gt;
&lt;br&gt;
ross</description>
    </item>
    <item>
      <pubDate>Tue, 25 Aug 2009 12:52:01 -0400</pubDate>
      <title>Re: problems printing to file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248868#675553</link>
      <author>Christophe Charbu</author>
      <description>Dear ross,&lt;br&gt;
Thank you for pointing out this problem.&lt;br&gt;
Do you find a solution to fix the figure size correctly?&lt;br&gt;
&lt;br&gt;
Thank you in advance.&lt;br&gt;
&lt;br&gt;
Christophe&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
ross &amp;lt;ross@nospam.com&amp;gt; wrote in message &amp;lt;49e2deda@news.mel.dft.com.au&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Jiro Doke&quot; &amp;lt;jiro.doke@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;To programmatically set the plot to save as you see on the screen, set the &lt;br&gt;
&amp;gt; &amp;gt;PaperPositionMode of the figure to &quot;auto&quot;.&lt;br&gt;
&amp;gt; &amp;gt; ......&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&amp;gt; set(gcf,'PaperPositionMode','auto')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks Jiro.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I should have guessed - it's this old problem of printer settings and concepts &lt;br&gt;
&amp;gt; interfering where they are not relevant.&lt;br&gt;
&amp;gt; Permit me a small rant - see if you agree with the following.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It's high time that printer specific concepts such as dpi and paper position &lt;br&gt;
&amp;gt; should be completely removed from the process of saving figures to graphics &lt;br&gt;
&amp;gt; files. It's insane and always has been.  I've been programming since the early &lt;br&gt;
&amp;gt; 70s and these concepts have confusing people ever since then.  How many &lt;br&gt;
&amp;gt; thousands of  times have you seen charts spewing out of the printer with the &lt;br&gt;
&amp;gt; wrong size because someone got confused between the file resolution, the dpi &lt;br&gt;
&amp;gt; and the printer settings?  Especially now, when the need for direct output to a &lt;br&gt;
&amp;gt; printer is becoming rarer.  Programmers in general find the concept of &lt;br&gt;
&amp;gt; specified pixel dimensions for the screen, and for the bitmapped graphics &lt;br&gt;
&amp;gt; files, a very easy one to master.   One just interpolates to make one fit the &lt;br&gt;
&amp;gt; other if necessary.  Dpi was a particularly iniquitous concept because it &lt;br&gt;
&amp;gt; introduced complexity where none was needed.  At bottom, a bitmapped graphics &lt;br&gt;
&amp;gt; file has a certain information density, and the printer in any given mode has &lt;br&gt;
&amp;gt; another.  A single ratio is logically enough. In printer-oriented contexts, &lt;br&gt;
&amp;gt; however, one was often drowning in ratios - dpi's for the file and printer, for &lt;br&gt;
&amp;gt; a start, plus other settings - and in the end fudge factors often had to be &lt;br&gt;
&amp;gt; applied before the output was what you'd expected.  Historically, it's been a &lt;br&gt;
&amp;gt; shambles.  Vectorised graphics have their own language, but again it's far less &lt;br&gt;
&amp;gt; confusing if file creation and printing from file are kept as separate &lt;br&gt;
&amp;gt; activities. Many academics and researchers want to save their figures to a file &lt;br&gt;
&amp;gt; in a suitable format, then interpolate, crop, overlay, edit, insert into &lt;br&gt;
&amp;gt; journal articles or presentations, email to friends or publishers, etc.  ALL of &lt;br&gt;
&amp;gt; this is done electronically, and printing simply doesn't come in to it.  All &lt;br&gt;
&amp;gt; printer-specific settings,  eg,  margins, dpi, paper size and position, should &lt;br&gt;
&amp;gt; be relegated to a special set of commands that are completely separate from &lt;br&gt;
&amp;gt; those used for creating graphics files. If we modularised these activities, and &lt;br&gt;
&amp;gt; the clarity and robustness of the command structure would improve considerably.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ross</description>
    </item>
  </channel>
</rss>

