Skip to content

Commit 4c88c1f

Browse files
committed
Merge pull request #4631 from ericmjl/import-changes-vline_hline_demo.py
Standardized imports
2 parents d2f91a1 + 970881d commit 4c88c1f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

examples/pylab_examples/vline_hline_demo.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
#!/usr/bin/env python
2-
31
"""
42
Small demonstration of the hlines and vlines plots.
53
"""
64

7-
from matplotlib import pyplot as plt
8-
from numpy import sin, exp, absolute, pi, arange
9-
from numpy.random import normal
5+
import matplotlib.pyplot as plt
6+
import numpy as np
7+
import numpy.random as rnd
108

119

1210
def f(t):
13-
s1 = sin(2 * pi * t)
14-
e1 = exp(-t)
15-
return absolute((s1 * e1)) + .05
16-
11+
s1 = np.sin(2 * np.pi * t)
12+
e1 = np.exp(-t)
13+
return np.absolute((s1 * e1)) + .05
1714

18-
t = arange(0.0, 5.0, 0.1)
15+
t = np.arange(0.0, 5.0, 0.1)
1916
s = f(t)
20-
nse = normal(0.0, 0.3, t.shape) * s
17+
nse = rnd.normal(0.0, 0.3, t.shape) * s
2118

2219
fig = plt.figure(figsize=(12, 6))
2320
vax = fig.add_subplot(121)

0 commit comments

Comments
 (0)