Make your MATLAB plots look like Excel 2007 Plots!

Author: Stephen E. Conover
Version: 1.1
Date: July 9, 2007
MATLAB Version: MATLAB Version 7.1.0.124 (R14) Service Pack 3 (STUDENT)
License: MIT License

The MATLAB Theme function creates an appealing line graph by mimicking the Microsoft Excel 2007 color schemes. This will make boring and ugly MATLAB come alive with appropriate color schemes... all with a single function call!

By default, the MATLAB line graphs are incredibly ugly. The colors are too simple, lines are too thin, and the text is too small. On the other hand, MS Excel 2007 contains an upgraded graphing engine that utilizes an advanced renderer and special color schemes that really do look good. With one easy call, theme() makes MATLAB graphs look like Excel 2007.

Theme() is free to use under the MIT License (see below).

 

Using the Themes

The theme function can be called in three different ways:

  1. Apply a theme to a figure
  2. Apply a theme to a single axes
  3. Apply a theme to all future plots as default

1. Apply a Theme to a Figure

To apply a theme to a figure, execute

theme(gcf, 'Office', false);

To get something like this:

2. Apply a Theme to an Individual Axes
 
If you pass the first parameter as a figure, the entire figure (including all subplots) will be changes to the theme. If you pass in a single axes, then only that one axes will be changed:
theme(gca, 'Office', false);

3. Apply a Theme as Default for All Future Plots

If you pass in zero (0) as the value for H, you are asking the function to set that theme as the default for all future plots. The next time you make a line graph, it will automatically have the theme you requested.

theme(0, 'verve', false)

Function Details

   THEME(H, themeID, useMarkers, lineWidth, 
	   markerSize, titleFontSize, axesFontSize)
Parameter Description
H A handle to an axes or figure your would like to apply the theme to, or zero (0) to indicate that the theme should be applied as default to all future plots. (Default is 0)
themeID The string name (such as 'solstice', or 'verve') of the theme, or the index (1-21) of the theme. (Default is 'office')
useMarkers Indicates whether to use markers or not (default false, not used with H=0)
lineWidth The width of the line to use in the theme (default is 3).
markerSize The size of the marker to use, if any (default is 5)
titleFontSize The size of the title (default is 12pt)
axesFontSize The size of the text and markers on the axes (default is 12pt)

 

Complete Index of Themes

MIT LICENSE

Copyright (c) 2007 Steve Conover.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 

 

© 2005 Copyright Steve Conover. All rights reserved.