Thu Nov 11 18:38:54 CET 2004  Norbert@...160...
  * add several kwargs to Legend.__init__

diff -rN -u matplotlib-old/lib/matplotlib/axes.py matplotlib-new/lib/matplotlib/axes.py
--- matplotlib-old/lib/matplotlib/axes.py	2004-11-17 11:14:10.000000000 +0100
+++ matplotlib-new/lib/matplotlib/axes.py	2004-11-17 11:14:10.000000000 +0100
@@ -1443,15 +1443,16 @@
 and so on
         """
 
-        loc = kwargs.get('loc', 1)
         if len(args)==0:
             labels = [line.get_label() for line in self.lines]
             lines = self.lines
+            loc = kwargs.pop('loc', 1)
 
         elif len(args)==1:
             # LABELS
             labels = args[0]
             lines = [line for line, label in zip(self.lines, labels)]
+            loc = kwargs.pop('loc', 1)
 
         elif len(args)==2:
             if is_string_like(args[1]) or isinstance(args[1], int):
@@ -1461,6 +1462,7 @@
             else:
                 # LINES, LABELS
                 lines, labels = args
+                loc = kwargs.pop('loc', 1)
 
         elif len(args)==3:
             # LINES, LABELS, LOC
@@ -1469,7 +1471,7 @@
             raise RuntimeError('Invalid arguments to legend')
 
         lines = flatten(lines)
-        self.legend_ = Legend(self, lines, labels, loc)
+        self.legend_ = Legend(self, lines, labels, loc, **kwargs)
         return self.legend_
 
     def loglog(self, *args, **kwargs):
diff -rN -u matplotlib-old/lib/matplotlib/figure.py matplotlib-new/lib/matplotlib/figure.py
--- matplotlib-old/lib/matplotlib/figure.py	2004-11-17 11:14:10.000000000 +0100
+++ matplotlib-new/lib/matplotlib/figure.py	2004-11-11 18:33:11.000000000 +0100
@@ -265,7 +265,7 @@
     def get_axes(self):
         return self.axes
 
-    def legend(self, handles, labels, loc):
+    def legend(self, handles, labels, loc, **kwargs):
         """
         Place a legend in the figure.  Labels are a sequence of
         strings, handles is a sequence of line or patch instances, and
@@ -296,7 +296,7 @@
 
 
         handles = flatten(handles)
-        l = Legend(self, handles, labels, loc, isaxes=False)
+        l = Legend(self, handles, labels, loc, isaxes=False, **kwargs)
         self._set_artist_props(l)
         self.legends.append(l)
         return l
diff -rN -u matplotlib-old/lib/matplotlib/legend.py matplotlib-new/lib/matplotlib/legend.py
--- matplotlib-old/lib/matplotlib/legend.py	2004-11-17 11:14:10.000000000 +0100
+++ matplotlib-new/lib/matplotlib/legend.py	2004-11-17 11:14:10.000000000 +0100
@@ -85,13 +85,21 @@
     AXESPAD = 0.02     # the border between the axes and legend edge
 
 
-    def __init__(self, parent, handles, labels, loc, isaxes=True):
+    def __init__(self, parent, handles, labels, loc, isaxes=True, **kwargs):
         Artist.__init__(self)
         if is_string_like(loc) and not self.codes.has_key(loc):
             verbose.report_error('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 = kwargs.pop('numpoints',self.NUMPOINTS)
+        self.FONTSIZE = kwargs.pop('fontsize',self.FONTSIZE)
+        self.PAD = kwargs.pop('pad',self.PAD)
+        self.LABELSEP = kwargs.pop('labelsep',self.LABELSEP)
+        self.HANDLELEN = kwargs.pop('handlelen',self.HANDLELEN)
+        self.HANDLETEXTSEP = kwargs.pop('handletextsep',self.HANDLETEXTSEP)
+        self.AXESPAD = kwargs.pop('axespad',self.AXESPAD)
+        if len(kwargs):
+            raise TypeError, 'Unknown argument "%s"'%kwargs.keys()[0]
         
         if isaxes:  # parent is an Axes
             self.set_figure(parent.figure)
diff -rN -u matplotlib-old/lib/matplotlib/matlab.py matplotlib-new/lib/matplotlib/matlab.py
--- matplotlib-old/lib/matplotlib/matlab.py	2004-11-17 11:14:10.000000000 +0100
+++ matplotlib-new/lib/matplotlib/matlab.py	2004-11-11 18:31:48.000000000 +0100
@@ -645,7 +645,7 @@
     return ret
 figimage.__doc__ = Figure.figimage.__doc__
     
-def figlegend(handles, labels, loc):
+def figlegend(handles, labels, loc, **kwargs):
     """
     Place a legend in the figure.  Labels are a sequence of
     strings, handles is a sequence of line or patch instances, and
@@ -661,7 +661,7 @@
 
     A matplotlib.legend.Legend instance is returned
     """
-    l=  gcf().legend(handles, labels, loc)
+    l=  gcf().legend(handles, labels, loc, **kwargs)
     draw_if_interactive()
     return l
     
