Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 070a839

Browse filesBrowse files
committed
mep12 on scatter_profile.py
1 parent 0bbc091 commit 070a839
Copy full SHA for 070a839

File tree

Expand file treeCollapse file tree

1 file changed

+7
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-10
lines changed
+7-10Lines 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.rand(N)
18+
y = 0.9*np.rand(N)
19+
s = 20*np.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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.