Update coordinate convention, inline matplotlib `clip_to_bbox`

The `clip_to_bbox` function is only available in later versions of Matplotlib,
so for now inline it so that we remain compatible with v1.1.