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

Skip to content

Commit d2f91a1

Browse files
committed
Merge pull request #4734 from ericmjl/mep12-scatter_profile.py
mep12 on scatter_profile.py
2 parents f37e6ef + 0ab33cc commit d2f91a1

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/usr/bin/env python
2-
# -*- noplot -*-
3-
41
"""
52
N Classic Base renderer Ext renderer
63
20 0.22 0.14 0.14
@@ -9,16 +6,16 @@
96
10000 3.30 1.31 0.53
107
50000 19.30 6.53 1.98
118
"""
12-
from __future__ import print_function
13-
import pylab
9+
from __future__ import print_function # only needed for python 2.x
10+
import matplotlib.pyplot as plt
11+
import numpy as np
1412

1513
import time
1614

17-
1815
for N in (20, 100, 1000, 10000, 50000):
1916
tstart = time.time()
20-
x = 0.9*pylab.rand(N)
21-
y = 0.9*pylab.rand(N)
22-
s = 20*pylab.rand(N)
23-
pylab.scatter(x, y, s)
17+
x = 0.9*np.random.rand(N)
18+
y = 0.9*np.random.rand(N)
19+
s = 20*np.random.rand(N)
20+
plt.scatter(x, y, s)
2421
print('%d symbols in %1.2f s' % (N, time.time() - tstart))

0 commit comments

Comments
 (0)