SciTools/cartopy — pull request #372 by ajdawson (2013-12-12 16:23:36+00:00)
Title: Correct wrapping and clipping of pcolormesh with IGH. Fixes #319.

This PR targets the core issue raised #319 and fixes pcolormesh plots using the Interrupted Goode Homolosine projection.

Details of the fix:
* The wrapping code in `_pcolormesh_patched()` wasn't being activated - fixed by adding the projection to the check list
* The plotted data wasn't being kept within the projection boundary - fixed by clipping the resultant QuadMesh to the projection boundary

Another issue came up while trying to write a test for this. On certain occasions the extra wrapped cells drawn by `pcolor()` were drawing over the top of the cells drawn by `pcolormesh()`. I fixed this by setting the zorder of those cells to be slightly lower than the cells drawn by `pcolormesh()`. Here is the IGH test image without setting zorder:
![goode_bad](https://f.cloud.github.com/assets/390602/1734500/08aa2aac-6347-11e3-9a58-74f84504e9e6.png)
I think setting the zorder is the right thing to do in this case. It did mean I had to change one existing test image, but I'd argue that the new one is more correct (the difference is very subtle anyway).

Outstanding problems:

This fix will unfortunately not solve the iris use case presented in #319, the code will just hang. However I think this is a problem with the `InterruptedGoodeHomolosine` projection rather than `pcolormesh()` since the same problem occurs with `contourf()`. An issue for this is already open (#325). I'm therefore treating this as out-of-scope for this PR.