Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e79e628

Browse files
committed
renamed fill_between example in pyplots: corrected error in the conversion to sphinx gallery
1 parent f65ab08 commit e79e628

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

examples/pyplots/fill_between.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""
2+
=============================
3+
Whats New 0.98.4 Fill Between
4+
=============================
5+
6+
"""
7+
import matplotlib.pyplot as plt
8+
import numpy as np
9+
10+
x = np.arange(-5, 5, 0.01)
11+
y1 = -5*x*x + x + 10
12+
y2 = 5*x*x + x
13+
14+
fig, ax = plt.subplots()
15+
ax.plot(x, y1, x, y2, color='black')
16+
ax.fill_between(x, y1, y2, where=y2>y1, facecolor='yellow', alpha=0.5)
17+
ax.fill_between(x, y1, y2, where=y2<=y1, facecolor='red', alpha=0.5)
18+
ax.set_title('Fill Between')
19+
20+
plt.show()

0 commit comments

Comments
 (0)