|
From: <ef...@us...> - 2010-04-19 21:02:50
|
Revision: 8244
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8244&view=rev
Author: efiring
Date: 2010-04-19 21:02:42 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
MaxNLocator: allow one non-keyword arg (nbins)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/ticker.py
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2010-04-19 18:28:54 UTC (rev 8243)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2010-04-19 21:02:42 UTC (rev 8244)
@@ -1058,7 +1058,7 @@
integer=False,
symmetric=False,
prune=None)
- def __init__(self, **kwargs):
+ def __init__(self, *args, **kwargs):
"""
Keyword args:
@@ -1090,6 +1090,11 @@
# I left "trim" out; it defaults to True, and it is not
# clear that there is any use case for False, so we may
# want to remove that kwarg. EF 2010/04/18
+ if args:
+ kwargs['nbins'] = args[0]
+ if len(args) > 1:
+ raise ValueError(
+ "Keywords are required for all arguments except 'nbins'")
self.set_params(**self.default_params)
self.set_params(**kwargs)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|