1) I'm wondering if there's a way to pre-define different
> defaults for different platforms. For example, I built an
> OS-X installer that doesn't support GTK, but the
> .matplotlibrc still had GtkAgg as the default. Yes, I could
> have edited the .matplotlib rc in my installer, but I'd
> have to do that each time I built a new one. It would be
> nice to have something in CVS that just worked.
This is what I do for the win32 builds -- hand edit the file before
each build. A little bit of a pain, bit it works (as long as you
remember to tweak the file before the build <wink>)
> 2) Perhaps we could make the processing of matplotlibrc
> smarter. For example: if numarray is specified, but not
> installed, and Numeric is, it could roll over to
> Numeric. Same thing with back-ends. Of course, this kind of
> breaks the "explicit is better than implicit" rule, but it
> would greatly improve the "It just works" qualities of MPL.
There is a consensus that the backend selector should be smarter. One
proposal is to iterate over a list of candidates and choose the first
one that works. Another is to set the backend in the default rc file
at setup.py build time. Both could be done, and the same arguments
apply to the numerix setting (AFAIK, These are the only two rc file
settings that might be advantageously set at build time).
I think we would readily accept a patch for either or both of these,
but there are those who already despise the amount of magic that pylab
engages in (and you are usually near the front of that chorus). Yes,
explicit is (usually) better than implicit, but this tends to conflict
with "just works".... Are you starting to experience a change of
FYI, the advertised behavior of numeric is as follows (eg
numerix imports either Numeric or numarray based on various
0. If the value "--numarray" or "--Numeric" is specified on the
command line, then numerix imports the specified array package.
1. The value of numerix in matplotlibrc: either Numeric or numarray
2. If none of the above is done, the default array package is
Numeric. Because the matplotlibrc always provides *some* value
for numerix (it has it's own system of default values), this
default is most likely never used.
To summarize: the commandline is examined first, the rc file second,
and the default array package is Numeric.
In your use case is this correct, or do we need to amend the build,
runtime or docs? According to your post, we should fall back on
Numeric if numarray is specified but not present. Reasonable, but
also a bit counter-intuitive since Numeric is the default and in this
case the user would have explicitly overridden the default. In the
case of an explicit override from the default, failing might be better
than just working....