Tue 06 Dec 2016 04:53:43 PM UTC, comment #3:
The list of axes props can be found here: http://www.mathworks.com/help/matlab/ref/axes-properties.html.
The Title property must contain a handle to a text object. In Matlab, you would do as Dan suggests and get the handle to the text object and then set fontsize, fontweight, etc. on the text object.
To be compatible, we could disallow the Octave-specific syntax of
but the syntax does seem convenient.
The text objects (like xlabel, title, ylabel) are created when the axes is initialized. We could probably default these objects to have
|
Tue 06 Dec 2016 08:59:25 AM UTC, comment #2:
Oh, this may not be a bug then. The title.m file does a set, but uses some extra parameters:
TitleFontSizeMultiplier and titlefontweight aren't something that set(gca, 'title', 'Nice Plot') can use in a generic sense.
I see that title() has an option where the axis handle can be passed in as the first argument. That's the proper way of controlling this, e.g.:
title(gca, 'hello', 'fontsize', 8)
The set(gca, 'title', '123') is more for directly tweaking the string parameters.
If there is one change to make, it might be that the default title settings for fontsize and fontweight are those listed above to match what the title does. But from there on, set(gca, 'title', '123') controls things.
What is a little odd is that the axis title is a handle, yet one is able to do
set(gca, 'title', 'world');
when it should maybe be
set(get(gca, 'title'), 'string', 'world');
Guess it's a shortcut, in a way.
|