<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161797</link>
    <title>MATLAB Central Newsreader - Default properties for figures and axes</title>
    <description>Feed for thread: Default properties for figures and axes</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>Wed, 09 Jan 2008 19:41:02 -0500</pubDate>
      <title>Default properties for figures and axes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161797#408761</link>
      <author>Petr Krysl</author>
      <description>I've always used programmatic means of setting the&lt;br&gt;
properties of figures to match my preferences. However, I&lt;br&gt;
was not happy: I would have liked to change the defaults&lt;br&gt;
that Matlab used for figures and axes. In other words, set&lt;br&gt;
the defaults once, and when you say &amp;#8220;figure&amp;#8221; you will get&lt;br&gt;
the correct colors, fonts (name, slant, size), tick&lt;br&gt;
directions,  marker size, in other words all the settings&lt;br&gt;
will be to your satisfaction.&lt;br&gt;
&lt;br&gt;
Here is what I found out would work. It uses undocumented&lt;br&gt;
properties of the root. I put this into a script that I run&lt;br&gt;
when I start Matlab working on a project where I need the&lt;br&gt;
figures to look a certain way:&lt;br&gt;
&lt;br&gt;
set(0, &amp;#8216;DefaultFigureColor&amp;#8217;, &amp;#8216;White&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultFigurePaperType&amp;#8217;, &amp;#8216;a4letter&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesColor&amp;#8217;, &amp;#8216;white&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesDrawmode&amp;#8217;, &amp;#8216;fast&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesFontUnits&amp;#8217;, &amp;#8216;points&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesFontSize&amp;#8217;, 14, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesFontAngle&amp;#8217;, &amp;#8216;Italic&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesFontName&amp;#8217;, &amp;#8216;Times&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesGridLineStyle&amp;#8217;, &amp;#8216;:&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesInterruptible&amp;#8217;, &amp;#8216;on&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesLayer&amp;#8217;, &amp;#8216;Bottom&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesNextPlot&amp;#8217;, &amp;#8216;replace&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesUnits&amp;#8217;, &amp;#8216;normalized&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesXcolor&amp;#8217;, [0, 0, 0], &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesYcolor&amp;#8217;, [0, 0, 0], &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesZcolor&amp;#8217;, [0, 0, 0], &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultAxesVisible&amp;#8217;, &amp;#8216;on&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultLineColor&amp;#8217;, &amp;#8216;Red&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultLineLineStyle&amp;#8217;, &amp;#8216;-&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultLineLineWidth&amp;#8217;, 2, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultLineMarker&amp;#8217;, &amp;#8216;none&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultLineMarkerSize&amp;#8217;, 8, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultTextColor&amp;#8217;, [0, 0, 0], &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultTextFontUnits&amp;#8217;, &amp;#8216;Points&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultTextFontSize&amp;#8217;, 14, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultTextFontName&amp;#8217;, &amp;#8216;Times&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultTextVerticalAlignment&amp;#8217;, &amp;#8216;middle&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;#8216;DefaultTextHorizontalAlignment&amp;#8217;, &amp;#8216;left&amp;#8217;);&lt;br&gt;
&lt;br&gt;
What I would like to check is whether it is a bad idea to&lt;br&gt;
use these undocumented properties, and if so if there is a&lt;br&gt;
better approach out there. Suggestions or comments, anyone?&lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
&lt;br&gt;
Petr</description>
    </item>
    <item>
      <pubDate>Wed, 09 Jan 2008 20:46:01 -0500</pubDate>
      <title>Re: Default properties for figures and axes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161797#408772</link>
      <author>Yair Altman</author>
      <description>&quot;Petr Krysl&quot; &amp;lt;pkryslNOSP@Mucsd.edu&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fm380e$obl$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I've always used programmatic means of setting the&lt;br&gt;
&amp;gt; properties of figures to match my preferences. However, I&lt;br&gt;
&amp;gt; was not happy: I would have liked to change the defaults&lt;br&gt;
&amp;gt; that Matlab used for figures and axes. In other words, set&lt;br&gt;
&amp;gt; the defaults once, and when you say &amp;#8220;figure&amp;#8221; you will get&lt;br&gt;
&amp;gt; the correct colors, fonts (name, slant, size), tick&lt;br&gt;
&amp;gt; directions,  marker size, in other words all the settings&lt;br&gt;
&amp;gt; will be to your satisfaction.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Here is what I found out would work. It uses undocumented&lt;br&gt;
&amp;gt; properties of the root. I put this into a script that I run&lt;br&gt;
&amp;gt; when I start Matlab working on a project where I need the&lt;br&gt;
&amp;gt; figures to look a certain way:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; set(0, &amp;#8216;DefaultFigureColor&amp;#8217;, &amp;#8216;White&amp;#8217;, &amp;#8230;&lt;br&gt;
&amp;lt;snip&amp;gt;&lt;br&gt;
&amp;gt; What I would like to check is whether it is a bad idea to&lt;br&gt;
&amp;gt; use these undocumented properties, and if so if there is a&lt;br&gt;
&amp;gt; better approach out there. Suggestions or comments, anyone?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Regards,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Petr&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Actually, this is entirely documented and not at all a bad&lt;br&gt;
idea:&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-21465.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-21465.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
You can set default property values at the axes, figure and&lt;br&gt;
root levels - all these are documented and fully supported.&lt;br&gt;
&lt;br&gt;
p.s. - You can also set the default value at the base class&lt;br&gt;
(schema.prop) level, but this is indeed undocumented.&lt;br&gt;
&lt;br&gt;
Yair Altman&lt;br&gt;
&lt;a href=&quot;http://ymasoftware.com&quot;&gt;http://ymasoftware.com&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 10 Jan 2008 01:24:02 -0500</pubDate>
      <title>Re: Default properties for figures and axes</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/161797#408809</link>
      <author>Petr Krysl</author>
      <description>Yair,&lt;br&gt;
&lt;br&gt;
Thank you so much for this link. &lt;br&gt;
&lt;br&gt;
&amp;gt; Actually, this is entirely documented and not at all a bad&lt;br&gt;
&amp;gt; idea:&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-21465.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-21465.html&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Inspired by your find I continued my digging in the&lt;br&gt;
documentation, and found at least one other place where the&lt;br&gt;
defaults are discussed:&lt;br&gt;
&lt;br&gt;
You can set default axes properties on the figure and root&lt;br&gt;
levels:set(0,'DefaultAxesPropertyName',PropertyValue,...)&lt;br&gt;
set(gcf,'DefaultAxesPropertyName',PropertyValue,...)where&lt;br&gt;
PropertyName is the name of the axes&lt;br&gt;
property and PropertyValue is the value you are specifying.&lt;br&gt;
Use set and get to&lt;br&gt;
access axes properties.&lt;br&gt;
&lt;br&gt;
So the documentation is there, it's just not terribly easy&lt;br&gt;
to find. And, importantly, setting up the default values&lt;br&gt;
this way is safe.&lt;br&gt;
&lt;br&gt;
Thanks again,&lt;br&gt;
&lt;br&gt;
Petr</description>
    </item>
  </channel>
</rss>

