diff --git a/examples/lines_bars_and_markers/fill_demo.py b/examples/lines_bars_and_markers/fill_demo.py index daecb7923d47..120036516955 100644 --- a/examples/lines_bars_and_markers/fill_demo.py +++ b/examples/lines_bars_and_markers/fill_demo.py @@ -1,9 +1,15 @@ """ -================== -A simple Fill plot -================== +============== +Fill plot demo +============== -This example showcases the most basic fill plot a user can do with matplotlib. +First example showcases the most basic fill plot a user can do with matplotlib. + +Second example shows a few optional features: + + * Multiple curves with a single command. + * Setting the fill color. + * Setting the opacity (alpha value). """ import numpy as np import matplotlib.pyplot as plt @@ -15,4 +21,11 @@ ax.fill(x, y, zorder=10) ax.grid(True, zorder=5) + +x = np.linspace(0, 2 * np.pi, 500) +y1 = np.sin(x) +y2 = np.sin(3 * x) + +fig, ax = plt.subplots() +ax.fill(x, y1, 'b', x, y2, 'r', alpha=0.3) plt.show() diff --git a/examples/lines_bars_and_markers/fill_demo_features.py b/examples/lines_bars_and_markers/fill_demo_features.py deleted file mode 100644 index efff86d2b78f..000000000000 --- a/examples/lines_bars_and_markers/fill_demo_features.py +++ /dev/null @@ -1,21 +0,0 @@ -""" -======================== -A more complex fill demo -======================== - -In addition to the basic fill plot, this demo shows a few optional features: - - * Multiple curves with a single command. - * Setting the fill color. - * Setting the opacity (alpha value). -""" -import numpy as np -import matplotlib.pyplot as plt - -x = np.linspace(0, 2 * np.pi, 500) -y1 = np.sin(x) -y2 = np.sin(3 * x) - -fig, ax = plt.subplots() -ax.fill(x, y1, 'b', x, y2, 'r', alpha=0.3) -plt.show()