Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Default properties for figures and axes
Date: Wed, 9 Jan 2008 19:41:02 +0000 (UTC)
Organization: University of California San Diego
Lines: 50
Message-ID: <fm380e$obl$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199907662 24949 172.30.248.38 (9 Jan 2008 19:41:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 9 Jan 2008 19:41:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 163259
Xref: news.mathworks.com comp.soft-sys.matlab:445089


I've always used programmatic means of setting the
properties of figures to match my preferences. However, I
was not happy: I would have liked to change the defaults
that Matlab used for figures and axes. In other words, set
the defaults once, and when you say &#8220;figure&#8221; you will get
the correct colors, fonts (name, slant, size), tick
directions,  marker size, in other words all the settings
will be to your satisfaction.

Here is what I found out would work. It uses undocumented
properties of the root. I put this into a script that I run
when I start Matlab working on a project where I need the
figures to look a certain way:

set(0, &#8216;DefaultFigureColor&#8217;, &#8216;White&#8217;, &#8230;
&#8216;DefaultFigurePaperType&#8217;, &#8216;a4letter&#8217;, &#8230;
&#8216;DefaultAxesColor&#8217;, &#8216;white&#8217;, &#8230;
&#8216;DefaultAxesDrawmode&#8217;, &#8216;fast&#8217;, &#8230;
&#8216;DefaultAxesFontUnits&#8217;, &#8216;points&#8217;, &#8230;
&#8216;DefaultAxesFontSize&#8217;, 14, &#8230;
&#8216;DefaultAxesFontAngle&#8217;, &#8216;Italic&#8217;, &#8230;
&#8216;DefaultAxesFontName&#8217;, &#8216;Times&#8217;, &#8230;
&#8216;DefaultAxesGridLineStyle&#8217;, &#8216;:&#8217;, &#8230;
&#8216;DefaultAxesInterruptible&#8217;, &#8216;on&#8217;, &#8230;
&#8216;DefaultAxesLayer&#8217;, &#8216;Bottom&#8217;, &#8230;
&#8216;DefaultAxesNextPlot&#8217;, &#8216;replace&#8217;, &#8230;
&#8216;DefaultAxesUnits&#8217;, &#8216;normalized&#8217;, &#8230;
&#8216;DefaultAxesXcolor&#8217;, [0, 0, 0], &#8230;
&#8216;DefaultAxesYcolor&#8217;, [0, 0, 0], &#8230;
&#8216;DefaultAxesZcolor&#8217;, [0, 0, 0], &#8230;
&#8216;DefaultAxesVisible&#8217;, &#8216;on&#8217;, &#8230;
&#8216;DefaultLineColor&#8217;, &#8216;Red&#8217;, &#8230;
&#8216;DefaultLineLineStyle&#8217;, &#8216;-&#8217;, &#8230;
&#8216;DefaultLineLineWidth&#8217;, 2, &#8230;
&#8216;DefaultLineMarker&#8217;, &#8216;none&#8217;, &#8230;
&#8216;DefaultLineMarkerSize&#8217;, 8, &#8230;
&#8216;DefaultTextColor&#8217;, [0, 0, 0], &#8230;
&#8216;DefaultTextFontUnits&#8217;, &#8216;Points&#8217;, &#8230;
&#8216;DefaultTextFontSize&#8217;, 14, &#8230;
&#8216;DefaultTextFontName&#8217;, &#8216;Times&#8217;, &#8230;
&#8216;DefaultTextVerticalAlignment&#8217;, &#8216;middle&#8217;, &#8230;
&#8216;DefaultTextHorizontalAlignment&#8217;, &#8216;left&#8217;);

What I would like to check is whether it is a bad idea to
use these undocumented properties, and if so if there is a
better approach out there. Suggestions or comments, anyone?

Regards,

Petr