As it is now, quiver() fails if you give it numpy.matrix objects, as this simple example shows:
>>> quiver(np.matrix(np.ones((32, 32))), np.matrix(np.ones((32, 32))))
It does so because it runs ravel() on the input, which if the input is a matrix gives a row matrix of shape (N, 1), instead of an array of shape (N,), which is what quiver expects in further calculations.
This pull request fixes this problem by running the input through np.asarray() before ravel() is called.
Fixed so that quiver does not fail if given matrices.
I see, yeah that's a problem. The function np.ma.asarray looked promising here, but it actually just converts a matrix into a masked matrix.
It's hard to realize what the problem is if you happen to do this though, so it would be great if we could spare the people who accidentally do this some headache, in any way possible. Should I just open up an issue?
You could open an issue. Unless other developers think we should put in extensive matrix trapping, the solution would be to put clear "matrix inputs are not supported and may cause hard-to-diagnose errors" warnings in the documentation.
Thank you for pointing out the problem and proposing a solution, but I am going to close this pull request.