From fa99a36f303aaad9896ef05dafaf105ae020f66c Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Sat, 11 Jul 2015 11:56:18 -0500 Subject: [PATCH 1/3] Standardized imports 1. Explicitly stated where functions are imported from. --- examples/pylab_examples/vline_hline_demo.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/pylab_examples/vline_hline_demo.py b/examples/pylab_examples/vline_hline_demo.py index 999b4a18eb81..49217921ac08 100644 --- a/examples/pylab_examples/vline_hline_demo.py +++ b/examples/pylab_examples/vline_hline_demo.py @@ -4,20 +4,21 @@ Small demonstration of the hlines and vlines plots. """ -from matplotlib import pyplot as plt -from numpy import sin, exp, absolute, pi, arange -from numpy.random import normal +import matplotlib.pyplot as plt +import numpy as np +import numpy.random as rnd + def f(t): - s1 = sin(2 * pi * t) - e1 = exp(-t) - return absolute((s1 * e1)) + .05 + s1 = np.sin(2 * np.pi * t) + e1 = np.exp(-t) + return np.absolute((s1 * e1)) + .05 -t = arange(0.0, 5.0, 0.1) +t = np.arange(0.0, 5.0, 0.1) s = f(t) -nse = normal(0.0, 0.3, t.shape) * s +nse = rnd.normal(0.0, 0.3, t.shape) * s fig = plt.figure(figsize=(12, 6)) vax = fig.add_subplot(121) From ed732a89d7a640560a127beb4c8ca87b94900eb5 Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Sat, 11 Jul 2015 14:04:26 -0500 Subject: [PATCH 2/3] PEP8 modifications --- examples/pylab_examples/vline_hline_demo.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/pylab_examples/vline_hline_demo.py b/examples/pylab_examples/vline_hline_demo.py index 49217921ac08..3562ab4f6446 100644 --- a/examples/pylab_examples/vline_hline_demo.py +++ b/examples/pylab_examples/vline_hline_demo.py @@ -8,14 +8,11 @@ import numpy as np import numpy.random as rnd - - def f(t): s1 = np.sin(2 * np.pi * t) e1 = np.exp(-t) return np.absolute((s1 * e1)) + .05 - t = np.arange(0.0, 5.0, 0.1) s = f(t) nse = rnd.normal(0.0, 0.3, t.shape) * s From 970881d813660afdfd928b40f0e6c6a1ed020829 Mon Sep 17 00:00:00 2001 From: Eric Ma Date: Sun, 19 Jul 2015 18:55:33 -0400 Subject: [PATCH 3/3] PEP8 changes --- examples/pylab_examples/vline_hline_demo.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/pylab_examples/vline_hline_demo.py b/examples/pylab_examples/vline_hline_demo.py index 3562ab4f6446..24f9c8119138 100644 --- a/examples/pylab_examples/vline_hline_demo.py +++ b/examples/pylab_examples/vline_hline_demo.py @@ -1,13 +1,12 @@ -#!/usr/bin/env python - """ Small demonstration of the hlines and vlines plots. """ -import matplotlib.pyplot as plt -import numpy as np +import matplotlib.pyplot as plt +import numpy as np import numpy.random as rnd + def f(t): s1 = np.sin(2 * np.pi * t) e1 = np.exp(-t)