MATLAB: Get(0,’default’) does not list all default properties

defaultdefault propertiesdefault valuegetroot

Here is my output in Matlab2012a for the following command:
>> get(0,'default')
ans =
defaultFigurePosition: [560 528 560 420]
defaultTextColor: [0 0 0]
defaultAxesXColor: [0 0 0]
defaultAxesYColor: [0 0 0]
defaultAxesZColor: [0 0 0]
defaultPatchFaceColor: [0 0 0]
defaultPatchEdgeColor: [0 0 0]
defaultLineColor: [0 0 0]
defaultFigureInvertHardcopy: 'on'
defaultFigureColor: [0.8000 0.8000 0.8000]
defaultAxesColor: [1 1 1]
defaultAxesColorOrder: [7x3 double]
defaultFigureColormap: [64x3 double]
defaultSurfaceEdgeColor: [0 0 0]
I know there are more default values than this as I can access them individually if I already know them (DefaultLineLineWidth, DefaultLineLineStyle, etc.) As far as I can tell this list should be massive. That command is the most common suggestion for listing default values.
Any suggestions on why it doesn't list all default values (related to figures/axes/plot/etc)? Thanks!

Best Answer

The default values precede the factory values. Default values found by get(0, 'default') have been set in the function matlabrc or anywhere else. The missing defaults use the factory settings. See doc: setting-default-property-values.
get(0, 'default')
% Does not contain 'defaultLineColor'
get(0, 'defaultLineColor')
% [0,0,0]

set(0, 'defaultLineColor', [1, 0, 0])
get(0, 'default')
% Does contain 'defaultLineColor'
% Set the value to the factory settings:
set(0, 'defaultLineColor', 'factory')
get(0, 'defaultLineColor')
% [0,0,0]
% Remove the default, such that the factory is used:
set(0, 'defaultLineColor', 'remove')
The magic strings 'default', 'remove', and 'factory' are used to control the default values. A sad side-effect is, that these strings cannot be used as values of properties directly:
figure;
uicontrol('String', 'default');
This does not show 'default' in a button, but an empty string! You have to use this:
uicontrol('String', '\default');
This is obviously a bad design from the very early days of Matlab kept for backward compatibility. Of course the special commands should be the ones started with a backslash.