matplotlib/matplotlib — pull request #1140 by tonysyu (2012-08-23 01:53:04+00:00)
Title: BUG: Fix fill_between when NaN values are present

When NaN values are passed to `fill_between`, the nan value gets replaced by a value at the origin. This PR reuses the function's mask handling to produce a more user-friendly result.

Here's an example demonstrating the issue.

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

x = np.linspace(0, 2*np.pi, 50)
y = np.sin(x)
y[10] = np.nan
y[30] = np.nan
plt.fill_between(x, y)
plt.show()
```