Darren Dale wrote:
In theory this should work, but although most of the properties seem to
have an effect (eg if I change from sans-serif to serif it clearly looks
different), the size property stubbornly refuses to change the size of
the text. Eg. 'large', 'small' and 'xx-small' all look the same. If you
don't believe me I can post some pictures.
You need to change tick.labelsize and axes.labelsize.
Mmh, as an outsider to the discussion, may I suggest that this sounds like a minor API consistency or ease of use buglet? I know that mpl has a million knobs that can be tweaked, but in the interest of making it as self-discoverable as possible, I'd suggest that collecting all text properties under a unified header would make things easier. I just had a look at the mpl rc file, and it seems like the font size settings are done in (at least) 4 separate places:
font.size : medium
axes.titlesize : 14 # fontsize of the axes title
axes.labelsize : 12 # fontsize of the x any y labels
tick.labelsize : 12 # fontsize of the tick labels
Furthermore, one of them uses Latex-style relative settings (small, medium, etc) and the others use fixed point sizes, while it's not clear if those three can also take relative expressions.
This is likely to confuse a newcomer (as David's hunt revealed), and it seems an unnecessarily complex default. Here's an idea for a different set of settings:
font.size.default : medium
font.size.axes_title : auto
font.size.axes_label : auto
font.size.tick_label : auto
The behavior would be (suitably commented in the file):
- font.size.default controls the default choice of font size, and all the others are chosen as default values (hopefully good ones) relative to that.
- If you are happy with the relative choices made by MPL, just changing font.size.default up or down will scale all your font sizes in that direction. This makes it easy, for example, to quickly rebuild a plot for a talk with larger fonts everywhere.
- If you really want to tweak each font size setting by hand, you can do so by specifying its value directly. The 'auto' value will make it revert to the mpl relative-to-font.size.default autosizing decision.
I think something like this has the dual advantages of being easier to find by anyone on their own (all font size attributes are under font.size) and simultaneously providing easy global tuning with full freedom for fine tweaking.
I realize that this brings the reverse problem: what if a user is tweaking with axes properties and doesn't find the font sizes for axes there? In the interest of auto-discovery, shouldn't all axes (or ticks) properties live under axes/ticks? This is a valid concern, an inescapable problem of hierarchical organizations whenever something can reasonably appear in more than one place.
*nix filesystems solve this nicely with symlinks. I don't know if that kind of effort is really needed here, and perhaps a simple comment in the rc file would suffice. But if dynamic auto-discovery is desirable (via setp or tab-completion, for example), comments in a text file won't suffice. In that case, perhaps the rc machinery could support something akin to symlinks, where one could say:
axes.labelsize = link(font.size.axes_label)
and this would actually report as such at runtime. This would allow keeping the defaults in one place, while still letting some things appear more than once if that makes conceptual sense.
I know this may sound to some like overkill, but if John went ahead and implemented matplotlib GUI widgets, I dont' see why we can't also have a mpl filesystem with symlinks! It would certainly help as we ramp up for the alpha release of the famed MDE (Matplotlib Desktop Environment)
Just an idea...
ps - in case it wasn't clear, only the last paragraph was a joke. The actual linking proposal is perfectly serious, and not hard to implement.
On Monday 05 September 2005 10:21 am, Howey, David A wrote: