default font size rc setting

I just want to double check before I commit this. We offer

    > a font.size rc setting, and users can modify that size by
    > setting fontsize='medium' or 'large', etc. However,
    > font.size does not globally set the default font size, to
    > axis labels, ticklabels, etc, they remain 12pt as
    > default. Should this be changed? If so, the change is
    > simple: from this: def __init__(self, size=12.0,
    > weight='normal'): to this: def __init__(self,
    > size=rcParams['font.size'], weight='normal'):

If you want to use rc defaults for kwargs, you do not want to use them
in the function definition, because then they will be set a module
load time and the defaults cannot be changed dynamically. Rather, you
want to use this idiom (eg lines.py)

    def __init__(self, xdata, ydata,
                 linewidth = None, # all Nones default to rc
                 ...):
        if linewidth is None : linewidth=rcParams['lines.linewidth']

Then if the user changes the rc param value, the constructor default
changes too.

JDH

Ok. So currently a user can put font.size:23.0, or font.size:medium or even
"large". The latter makes things very confusing, because who knows what the
reference point is? (Its 12, but its not clear.)

I propose the following change: font.defaultsize demands a point size, and
then allow the relative font sizes to scale that size. Also, add a
text.fontsize rc parameter to allow such scaling for text (this is what
font.size does now, I think).

Are these changes ok, or should I just leave everything alone?

Darren

···

On Thursday 09 February 2006 11:22, you wrote:

    > I just want to double check before I commit this. We offer
    > a font.size rc setting, and users can modify that size by
    > setting fontsize='medium' or 'large', etc. However,
    > font.size does not globally set the default font size, to
    > axis labels, ticklabels, etc, they remain 12pt as
    > default. Should this be changed? If so, the change is
    > simple: from this: def __init__(self, size=12.0,
    > weight='normal'): to this: def __init__(self,
    > size=rcParams['font.size'], weight='normal'):

If you want to use rc defaults for kwargs, you do not want to use them
in the function definition, because then they will be set a module
load time and the defaults cannot be changed dynamically. Rather, you
want to use this idiom (eg lines.py)

    def __init__(self, xdata, ydata,
                 linewidth = None, # all Nones default to rc
                 ...):
        if linewidth is None : linewidth=rcParams['lines.linewidth']

Then if the user changes the rc param value, the constructor default
changes too.