It seems that the root object, a.k.a 0
has hidden properties in Matlab. For example, DefaultTextInterpreter
is one of them:
x = get(0,'DefaultTextInterpreter');
When I use
get(0)
I get a long list, which does not include DefaultTextInterpreter
.
Even setting undocumented properties to be visible by
set(0,'HideUndocumented','off');
does not seem to help.
How can I find all of the properties of the root object, including DefaultTextInterpreter
?
A short summary: The root object is the parent object of all figures. Some of its properties belong to the Matlab session, as e.g. the CurrentFigure. Some concern the current computer setup as the ScreenSize or the PointerLocation.
The value of each property can be accessed using the keys with an array notation of the object. Therefore, the keys are not required to be known beforehand to get all the property values.
You can get a list of a type’s properties using reflection, like this: Note: If you have an object, use movie.GetType ().GetProperties () instead.
The three approaches above should make it easy to show all of the available properties on an object in Python. using dir () is probably the most useful as it is the easiest to read.
Default properties are not hidden nor undocumented - they are available for all standard Handle Graphics properties by simply prefixing 'Default' to the property name, together with the object type ('Line', 'Axes' etc.). This is explained in the official documentation.
In fact, this mechanism also works for hidden/undocumented properties, as shown for the LineSmoothing property.
To see all the supported default properties, do as follows:
>> get(0,'Default')
ans =
defaultFigurePosition: [440 378 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.8 0.8 0.8]
defaultAxesColor: [1 1 1]
defaultAxesColorOrder: [7x3 double]
defaultFigureColormap: [64x3 double]
defaultSurfaceEdgeColor: [0 0 0]
defaultFigurePaperType: 'A4'
defaultFigurePaperUnits: 'centimeters'
defaultFigurePaperSize: [20.98404194812 29.67743169791]
Note that this does not return the undocumented defaults. You can always get the undocumented defaults directly:
>> get(0,'DefaultLineLineSmoothing')
ans =
off
>> p = findprop(handle(gcf),'pos')
p =
schema.prop
>> p.get
Name: 'Position'
Description: ''
DataType: 'figurePositionType'
FactoryValue: [100 100 660 520]
AccessFlags: [1x1 struct]
Visible: 'on'
GetFunction: []
SetFunction: []
In this simple snippet, note that the default (FactoryValue) for the position property of the UDD hg.Figure class is different than the HG default that is returned by the root's DefaultFigurePosition property. More information on UDD properties can be found here.
Addendum 2013-02-13: I've just posted a detailed article explaining how Matlab's Default and Factory property values work, how they relate to each other, and how they can be accessed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With