From efb2999da8241c5a85b20c416a5e4afe22a01075 Mon Sep 17 00:00:00 2001 From: patniharshit Date: Sun, 26 Feb 2017 16:57:34 +0530 Subject: [PATCH 1/4] merge fill_demo and fill_demo_features --- examples/lines_bars_and_markers/fill_demo.py | 25 ++++++++++++++++--- .../fill_demo_features.py | 21 ---------------- 2 files changed, 22 insertions(+), 24 deletions(-) delete mode 100644 examples/lines_bars_and_markers/fill_demo_features.py diff --git a/examples/lines_bars_and_markers/fill_demo.py b/examples/lines_bars_and_markers/fill_demo.py index daecb7923d47..72bad2c4f572 100644 --- a/examples/lines_bars_and_markers/fill_demo.py +++ b/examples/lines_bars_and_markers/fill_demo.py @@ -1,3 +1,6 @@ +import numpy as np +import matplotlib.pyplot as plt + """ ================== A simple Fill plot @@ -5,9 +8,6 @@ This example showcases the most basic fill plot a user can do with matplotlib. """ -import numpy as np -import matplotlib.pyplot as plt - x = np.linspace(0, 1, 500) y = np.sin(4 * np.pi * x) * np.exp(-5 * x) @@ -16,3 +16,22 @@ ax.fill(x, y, zorder=10) ax.grid(True, zorder=5) plt.show() + +""" +======================== +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). +""" +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() From 728158c1bf8e274e95f792cb499c6c56f720a3fe Mon Sep 17 00:00:00 2001 From: patniharshit Date: Sun, 26 Feb 2017 17:14:33 +0530 Subject: [PATCH 2/4] move imports below title --- examples/lines_bars_and_markers/fill_demo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/lines_bars_and_markers/fill_demo.py b/examples/lines_bars_and_markers/fill_demo.py index 72bad2c4f572..383342f0aaf7 100644 --- a/examples/lines_bars_and_markers/fill_demo.py +++ b/examples/lines_bars_and_markers/fill_demo.py @@ -1,6 +1,3 @@ -import numpy as np -import matplotlib.pyplot as plt - """ ================== A simple Fill plot @@ -8,6 +5,9 @@ This example showcases the most basic fill plot a user can do with matplotlib. """ +import numpy as np +import matplotlib.pyplot as plt + x = np.linspace(0, 1, 500) y = np.sin(4 * np.pi * x) * np.exp(-5 * x) From 71b82a20ae50a7d8337933c96449faf3ffa67e95 Mon Sep 17 00:00:00 2001 From: patniharshit Date: Mon, 27 Feb 2017 17:09:53 +0530 Subject: [PATCH 3/4] Merge docstring coherent --- examples/lines_bars_and_markers/fill_demo.py | 25 ++++++++------------ 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/examples/lines_bars_and_markers/fill_demo.py b/examples/lines_bars_and_markers/fill_demo.py index 383342f0aaf7..270f7af0618e 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 @@ -17,17 +23,6 @@ ax.grid(True, zorder=5) plt.show() -""" -======================== -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). -""" x = np.linspace(0, 2 * np.pi, 500) y1 = np.sin(x) y2 = np.sin(3 * x) From b4c81403135b54c56ec6a3c341f16654c0eb980e Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Tue, 7 Mar 2017 22:17:13 -0800 Subject: [PATCH 4/4] DOC removed redundant call to plt.show() --- examples/lines_bars_and_markers/fill_demo.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/lines_bars_and_markers/fill_demo.py b/examples/lines_bars_and_markers/fill_demo.py index 270f7af0618e..120036516955 100644 --- a/examples/lines_bars_and_markers/fill_demo.py +++ b/examples/lines_bars_and_markers/fill_demo.py @@ -21,7 +21,6 @@ ax.fill(x, y, zorder=10) ax.grid(True, zorder=5) -plt.show() x = np.linspace(0, 2 * np.pi, 500) y1 = np.sin(x)