Pep8ify examples

This PR converts the animation, api and axes_grid examples.

(Retry of #3182/#3183)

I addressed @ianthomas23' comments from #3183
This comment belongs with this function. It shouldn't get separated from it with the two space rule. This might have happened elsewhere too.