? matplotlibrc
? rwklegend.patch
? sessions.vim
? test.txt
Index: .cvsignore
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/.cvsignore,v
retrieving revision 1.4
diff -u -r1.4 .cvsignore
--- .cvsignore	16 Dec 2005 13:37:26 -0000	1.4
+++ .cvsignore	13 Jan 2006 04:52:32 -0000
@@ -3,4 +3,3 @@
 docs
 *.pyc
 .project
-matplotlibrc
Index: lib/matplotlib/__init__.py
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/lib/matplotlib/__init__.py,v
retrieving revision 1.95
diff -u -r1.95 __init__.py
--- lib/matplotlib/__init__.py	12 Jan 2006 12:02:49 -0000	1.95
+++ lib/matplotlib/__init__.py	13 Jan 2006 04:52:34 -0000
@@ -766,6 +766,20 @@
 
     'polaraxes.grid'         : [True, validate_bool],   # display polar grid or not
 
+    #legend properties
+    'legend.isaxes'	:	[True,validate_bool],
+    'legend.numpoints' 	:	[ 4,validate_int],      # the number of points in the legend line
+    'legend.fontsize' : ["small",validate_fontsize],
+    'legend.pad' 	:	[ 0.2, validate_float],         # the fractional whitespace inside the legend border
+    'legend.markerscale' 	:	[ 0.6, validate_float],    # the relative size of legend markers vs. original
+    # the following dimensions are in axes coords
+    'legend.labelsep' 	:	[ 0.005, validate_float],    # the vertical space between the legend entries
+    'legend.handlelen' 	:	[ 0.05, validate_float],  # the length of the legend lines
+    'legend.handletextsep' 	:	[ 0.02, validate_float], # the space between the legend line and legend text
+    'legend.axespad' 	:	[ 0.02, validate_float], # the border between the axes and legend edge
+    'legend.shadow' : [ False, validate_bool ],
+
+
     # tick properties
     'xtick.major.size'   : [5, validate_float],      # major xtick size in points
     'xtick.minor.size'   : [2, validate_float],      # minor xtick size in points
Index: lib/matplotlib/legend.py
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/lib/matplotlib/legend.py,v
retrieving revision 1.33
diff -u -r1.33 legend.py
--- lib/matplotlib/legend.py	26 Oct 2005 21:21:41 -0000	1.33
+++ lib/matplotlib/legend.py	13 Jan 2006 04:52:34 -0000
@@ -25,7 +25,7 @@
 from numerix import array, ones, Float
 
 
-from matplotlib import verbose
+from matplotlib import verbose, rcParams
 from artist import Artist
 from cbook import enumerate, is_string_like, iterable, silent_list
 from font_manager import FontProperties
@@ -110,18 +110,18 @@
 
 
     def __init__(self, parent, handles, labels, loc,
-                 isaxes=True,
-                 numpoints = 4,      # the number of points in the legend line
-                 prop = FontProperties(size='smaller'),
-                 pad = 0.2,          # the fractional whitespace inside the legend border
-                 markerscale = 0.6,    # the relative size of legend markers vs. original
+                 isaxes= None,
+                 numpoints = None,      # the number of points in the legend line
+                 prop = None,
+                 pad = None,          # the fractional whitespace inside the legend border
+                 markerscale = None,    # the relative size of legend markers vs. original
                  # the following dimensions are in axes coords
-                 labelsep = 0.005,     # the vertical space between the legend entries
-                 handlelen = 0.05,     # the length of the legend lines
-                 handletextsep = 0.02, # the space between the legend line and legend text
-                 axespad = 0.02,       # the border between the axes and legend edge
+                 labelsep = None,     # the vertical space between the legend entries
+                 handlelen = None,     # the length of the legend lines
+                 handletextsep = None, # the space between the legend line and legend text
+                 axespad = None,       # the border between the axes and legend edge
 
-                 shadow=False,
+                 shadow= None,
                  ):
         """
   parent                # the artist that contains the legend
@@ -146,19 +146,19 @@
             warnings.warn('Unrecognized location %s. Falling back on upper right; valid locations are\n%s\t' %(loc, '\n\t'.join(self.codes.keys())))
         if is_string_like(loc): loc = self.codes.get(loc, 1)
 
-        self.numpoints = numpoints
-        self.prop = prop
-        self.fontsize = prop.get_size_in_points()
-        self.pad = pad
-        self.markerscale = markerscale
-        self.labelsep = labelsep
-        self.handlelen = handlelen
-        self.handletextsep = handletextsep
-        self.axespad = axespad
-        self.shadow = shadow
+        proplist=[numpoints, pad, markerscale, labelsep, handlelen, handletextsep, axespad, shadow, isaxes]
+        propnames=['numpoints', 'pad', 'markerscale', 'labelsep', 'handlelen', 'handletextsep', 'axespad', 'shadow', 'isaxes']
+        for name, value in zip(propnames,proplist):
+            if value is None:
+                value=rcParams["legend."+name]
+            setattr(self,name,value)
+        if prop is None:
+            self.prop=FontProperties(size=rcParams["legend.fontsize"])
+        else:
+            self.prop=prop
+        self.fontsize = self.prop.get_size_in_points()
 
-        self.isaxes = isaxes
-        if isaxes:  # parent is an Axes
+        if self.isaxes:  # parent is an Axes
             self.set_figure(parent.figure)
         else:        # parent is a Figure
             self.set_figure(parent)
