matplotlib/matplotlib — pull request #1189 by tonysyu (2012-09-01 21:53:44+00:00)
Title: BUG: Fix streamplot when velocity component is exactly zero.

When one component of the velocity field is zero, streamplot fails to draw streamlines. Here's a short example of the issue:

```python
import matplotlib.pyplot as plt
import numpy as np

N = 10
Y, X = np.mgrid[:N, :N]
U = np.ones((N, N))
V = np.zeros((N, N))

plt.streamplot(X, Y, U, V)
plt.show()
```

Explanation of fix:
Negative and positive steps are treated differently by the code. Before, a zero gradient (`cx`, `cy`) was getting treated as a negative step. This resulted in a step size of `-inf`; treating zero as a positive step results in a step size of (positive) `inf`. This `inf` value gets filtered out since the integration routine chooses the smaller of the two (`dsx`, `dsy`) step sizes.