matplotlib/matplotlib — pull request #3060 by montefra (2014-05-13 20:14:01+00:00)
Title: converted assert into exception

A few days I ago I was experimenting for a possible answer to [this question](http://matplotlib.1069221.n5.nabble.com/Re-combine-different-axes-to-make-new-figure-in-matplotlib-td43385.html). While trying

fig1, ax1 = plt.subplots()
fig2, ax2 = plt.subplots()
fig2.add_axes(ax1)
I stumbled into an `AssertionError` without any explanation (I had to get the doc of `add_axes`).
My understanding is that `assert` should be reserved for debugging, not to throw errors if the user give a wrong parameter. So I've converted them to exception.

I've also noticed that `assert` is used all over the places. If there are no strong opinions in the next weeks I'll to go through the code and convert them to exceptions.