<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152026</link>
    <title>MATLAB Central Newsreader - exporting figures from the command line</title>
    <description>Feed for thread: exporting figures from the command line</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>Tue, 10 Jul 2007 16:39:57 -0400</pubDate>
      <title>exporting figures from the command line</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152026#382179</link>
      <author>o_depot</author>
      <description>Hey guys,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;When I'm exporting a figure I usually use the 'File &amp;gt; Export&lt;br&gt;
Setup...' GUI for settings. I have a custom style that I use on all&lt;br&gt;
my figures, which I've saved to 'pub_style1'. I usually apply the&lt;br&gt;
style, then use the 'Export' button to export the picture as a .png&lt;br&gt;
file.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;I was wondering if there was a way to do all this from the MATLAB&lt;br&gt;
command-line...?&lt;br&gt;
&lt;br&gt;
Thanks.</description>
    </item>
    <item>
      <pubDate>Tue, 10 Jul 2007 20:53:53 -0400</pubDate>
      <title>Re: exporting figures from the command line</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152026#382183</link>
      <author>Urs (us) Schwarz</author>
      <description>&amp;lt;SNIP &amp;lt;print&amp;gt;ing from the command line...&lt;br&gt;
&lt;br&gt;
a hint:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;help print;&lt;br&gt;
% then, look at options&lt;br&gt;
%    -dpng&lt;br&gt;
%    -r&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
    <item>
      <pubDate>Tue, 10 Jul 2007 18:38:44 -0400</pubDate>
      <title>Re: exporting figures from the command line</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152026#382195</link>
      <author>o_depot</author>
      <description>us wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;lt;SNIP &amp;lt;print&amp;gt;ing from the command line...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; a hint:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; help print;&lt;br&gt;
&amp;gt; % then, look at options&lt;br&gt;
&amp;gt; % -dpng&lt;br&gt;
&amp;gt; % -r&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; us&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&lt;br&gt;
&lt;br&gt;
thanks us,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;I've used the print command before, -dpng to output as a png, and&lt;br&gt;
-r to set resolution. The 'pub_style1' style that I've saved (and&lt;br&gt;
load through the Export GUI) has many tweaks and changes. Is there&lt;br&gt;
some way to load that style using the print command? Otherwise, is&lt;br&gt;
the only other option to specify each one of these tweaks as flags to&lt;br&gt;
the print command, or modifying the figure from the command line?&lt;br&gt;
It would be nice to run a command which loads up my the 'pub_style1'&lt;br&gt;
style, applies it to the current figure, then exports the figure as a&lt;br&gt;
png (or whatever format)...</description>
    </item>
    <item>
      <pubDate>Tue, 10 Jul 2007 18:59:19 -0400</pubDate>
      <title>Re: exporting figures from the command line</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/152026#382198</link>
      <author>us</author>
      <description>o_depot:&lt;br&gt;
&amp;lt;SNIP exporting a fig using a custom style sheet...&lt;br&gt;
&lt;br&gt;
one of the (few) solutions&lt;br&gt;
&lt;br&gt;
% assume your style sheet's name is &amp;lt;foo.txt&amp;gt;&lt;br&gt;
&lt;br&gt;
% create a fig&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plot(1:10);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fnam='your_fig.png'; % your file name&lt;br&gt;
% the engine&lt;br&gt;
% ...get style sheet info&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;snam='foo'; % note: NO extension...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s=hgexport('readstyle',snam);&lt;br&gt;
% ...apply style sheet info&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hgexport(gcf,fnam,s);&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
  </channel>
</rss>

