astrofrog/wcsaxes — pull request #117 by astrofrog (2014-10-06 08:18:16+00:00)
Title: Patch needs to be updated as soon as it is accessed

The following example demonstrates a bug in the current code:

```
import numpy as np
import matplotlib.pyplot as plt

from wcsaxes import WCSAxes

fig = plt.figure()
ax = WCSAxes(fig, [0.1, 0.1, 0.8, 0.8], aspect='equal')
fig.add_axes(ax)

im = ax.imshow(np.random.random((12,4)))

fig.savefig('test1.png')

ax.imshow(np.random.random((24,24)), origin='lower')

fig.savefig('test2.png')
```

The ``test2.png`` file looks like:

![test2](https://cloud.githubusercontent.com/assets/314716/4520202/15542990-4ce1-11e4-88b0-ad12c275260e.png)

The clip path is the one from the first array. One solution is to have ``patch`` be a property that is evaluated on-the-fly.