Here is my first attempt at patch submission. This patch aims to make
it possible to set legend properties (like fontsize) in the
added legend options to rc file
To the main __init__.py file I have added lines 769-780
to set default
rc values for legend related parameters. The attached
file is just an example of setting the legend parameters.
There are several changes to legend.py:
1. added ,rcParams to the end of line 29:
from matplotlib import verbose, rcParams
2. lines 112-124 set all the defaults for the keyword
None as you suggested.
3. changed how the values for things like
self.numpoints are handled
to check if they are none and look them up from
rcParams are you
suggested lines 149-159.
I don't know if there is a way to use kwargs here
instead of the
crude dictionary I set up in this part, but it works.
Let me know if
there is a cleaner way.
4. changed line 161 to check self.isaxes instead of
isaxes now defaults to None:
if self.isaxes: # parent is an Axes
One thing I don't seem to be able to do is make the diff pick up the
matplotlibrc changes. The following lines need to be added to make
this feature useful:
legend.numpoints =09:=094 # the number of points in the legend line
legend.fontsize : 14
legend.pad =09:=090.2 # the fractional whitespace inside the legend border
legend.markerscale =09:=091.0 # the relative size of legend markers vs. =
# the following dimensions are in axes coords
legend.labelsep =09:=090.010 # the vertical space between the legend entrie=
legend.handlelen =09:=090.05 # the length of the legend lines
legend.handletextsep =09:=090.02 # the space between the legend line and le=
legend.axespad =09:=090.02 # the border between the axes and legend e=
Let me know what to do from here.
If it matters, I created the diff from inside the directory
cvs/matplotlib on my computer (I don't know if the default would be
one level up from that for most people or not).
From: John Hunter <jdhunter@ac...> - 2006-01-19 23:40:38
>>>>> "Ryan" == Ryan Krauss <ryanlists@...> writes:
Ryan> One thing I don't seem to be able to do is make the diff
Ryan> pick up the matplotlibrc changes. The following lines need
Ryan> to be added to make this feature useful:
I don't know if I failed to mention this somewhere else or not, but
this is because the rc is now autogenerated by setup.py from the
matplotlibrc.template file. So that is where changes like
legend.isaxes : True
legend.numpoints : 4 # the number of points in the legend line
legend.fontsize : 14
legend.pad : 0.2 # the fractional whitespace inside the legend border
should go. I added these and they are no in CVS.