|
1 | 1 | from __future__ import print_function |
2 | | -from pylab import figure, show, nx |
| 2 | +from pylab import figure, show, np |
3 | 3 |
|
4 | 4 | Ntests = 3 |
5 | | -t = nx.arange(0.0, 1.0, 0.05) |
6 | | -s = nx.sin(2*nx.pi*t) |
| 5 | +t = np.arange(0.0, 1.0, 0.05) |
| 6 | +s = np.sin(2*np.pi*t) |
7 | 7 |
|
8 | 8 | # scatter creates a RegPolyCollection |
9 | 9 | fig = figure() |
10 | 10 | ax = fig.add_subplot(Ntests, 1, 1) |
11 | 11 | N = 100 |
12 | | -x, y = 0.9*nx.mlab.rand(2,N) |
13 | | -area = nx.pi*(10 * nx.mlab.rand(N))**2 # 0 to 10 point radiuses |
| 12 | +x, y = 0.9*np.random.rand(2,N) |
| 13 | +area = np.pi*(10 * np.random.rand(N))**2 # 0 to 10 point radiuses |
14 | 14 | ax.scatter(x,y,s=area, marker='^', c='r', label='scatter') |
15 | 15 | ax.legend() |
16 | 16 |
|
17 | 17 | # vlines creates a LineCollection |
18 | 18 | ax = fig.add_subplot(Ntests, 1, 2) |
19 | | -ax.vlines(t, [0], nx.sin(2*nx.pi*t), label='vlines') |
| 19 | +ax.vlines(t, [0], np.sin(2*np.pi*t), label='vlines') |
20 | 20 | ax.legend() |
21 | 21 |
|
22 | 22 | # vlines creates a LineCollection |
|
0 commit comments