matplotlib/matplotlib — pull request #3078 by andreasWallner (2014-05-20 00:28:45+00:00)
Title: fix argument checks in axis/base.margins

I tried this code today when guessing parameter names:
```python
import matplotlib.pyplot as plt
ax = plt.subplot(1,1,1)
ax.plot([1,10])
ax.margins(x=0.1, y=0)
```
Which should set the axis margins (according to the function docstring) but throws this error
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in ()
2 ax = plt.subplot(1,1,1)
3 ax.plot([1,10])
----> 4 ax.margins(x=0.1, y=0)
5

C:\Python33\lib\site-packages\matplotlib\axes.py in margins(self, *args, **kw)
1840 mx, my = args
1841 else:
-> 1842 raise ValueError("more than two arguments were supplied")
1843 if mx is not None:
1844 self.set_xmargin(mx)

ValueError: more than two arguments were supplied
```

After looking at the code it seems to me that the keyword parameters where simply forgotten in the checks.
This patch fixes this problem and provides test cases for all call variants of margins.

PS: I hope I did not add too many pictures for such a simple test, but I did not find a way to check for the same picture twice (margins_1_05_arg.png & margins_1_05_kwarg.png).