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

Skip to content

Commit fa99a36

Browse files
committed
Standardized imports
1. Explicitly stated where functions are imported from.
1 parent 0a5314a commit fa99a36

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

examples/pylab_examples/vline_hline_demo.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
Small demonstration of the hlines and vlines plots.
55
"""
66

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

1112

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

1718

18-
t = arange(0.0, 5.0, 0.1)
19+
t = np.arange(0.0, 5.0, 0.1)
1920
s = f(t)
20-
nse = normal(0.0, 0.3, t.shape) * s
21+
nse = rnd.normal(0.0, 0.3, t.shape) * s
2122

2223
fig = plt.figure(figsize=(12, 6))
2324
vax = fig.add_subplot(121)

0 commit comments

Comments
 (0)