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

Skip to content

Commit e391d69

Browse files
committed
merge fill_demo and fill_demo_features
1 parent 4f2d77d commit e391d69

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed
Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import numpy as np
2+
import matplotlib.pyplot as plt
3+
14
"""
25
==================
36
A simple Fill plot
47
==================
58
69
This example showcases the most basic fill plot a user can do with matplotlib.
710
"""
8-
import numpy as np
9-
import matplotlib.pyplot as plt
10-
1111
x = np.linspace(0, 1, 500)
1212
y = np.sin(4 * np.pi * x) * np.exp(-5 * x)
1313

@@ -16,3 +16,22 @@
1616
ax.fill(x, y, zorder=10)
1717
ax.grid(True, zorder=5)
1818
plt.show()
19+
20+
"""
21+
========================
22+
A more complex fill demo
23+
========================
24+
25+
In addition to the basic fill plot, this demo shows a few optional features:
26+
27+
* Multiple curves with a single command.
28+
* Setting the fill color.
29+
* Setting the opacity (alpha value).
30+
"""
31+
x = np.linspace(0, 2 * np.pi, 500)
32+
y1 = np.sin(x)
33+
y2 = np.sin(3 * x)
34+
35+
fig, ax = plt.subplots()
36+
ax.fill(x, y1, 'b', x, y2, 'r', alpha=0.3)
37+
plt.show()

examples/lines_bars_and_markers/fill_demo_features.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)