matplotlib/matplotlib — pull request #942 by pelson (2012-06-11 16:25:34+00:00)
Title: Text wrapping & better handling of kwargs in pyplot

As mentioned in #928, I have some improvements to pyplot which required an improved workflow for generating the pyplot script in the first place. These are those changes.

Firstly, I have added text wrapping in the pyplot module such that no autogenerated line is longer than 80 characters.

Secondly, I have fixed a bug where keyword passing is miss-handled (keywords were previously being passed as positional arguments), which is best demonstrated by the following example:

```
import matplotlib.pyplot as plt
import matplotlib.axes as maxes
import matplotlib.projections as mproj

class MyAxes(maxes.Axes):
name = 'myaxes'
def imshow(self, *args, **kwargs):
kwargs.setdefault('alpha', 0.5)
maxes.Axes.imshow(self, *args, **kwargs)

mproj.register_projection(MyAxes)

plt.gca(projection='myaxes')
plt.imshow('my_img.png')
```

Resulting in the following error:

```
TypeError: imshow() got multiple values for keyword argument 'alpha'
```