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 ee9e046

Browse filesBrowse files
committed
Merge pull request #5117 from ericmjl/mep12-fill_spiral.py
mep12 on fill_spiral.py
2 parents 05a93a0 + be2368c commit ee9e046
Copy full SHA for ee9e046

File tree

Expand file treeCollapse file tree

1 file changed

+13
-14
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-14
lines changed
+13-14Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
#!/usr/bin/env python
1+
import matplotlib.pyplot as plt
2+
import numpy as np
23

3-
from pylab import *
4-
5-
theta = arange(0, 8*pi, 0.1)
4+
theta = np.arange(0, 8*np.pi, 0.1)
65
a = 1
76
b = .2
87

9-
for dt in arange(0, 2*pi, pi/2.0):
8+
for dt in np.arange(0, 2*np.pi, np.pi/2.0):
109

11-
x = a*cos(theta + dt)*exp(b*theta)
12-
y = a*sin(theta + dt)*exp(b*theta)
10+
x = a*np.cos(theta + dt)*np.exp(b*theta)
11+
y = a*np.sin(theta + dt)*np.exp(b*theta)
1312

14-
dt = dt + pi/4.0
13+
dt = dt + np.pi/4.0
1514

16-
x2 = a*cos(theta + dt)*exp(b*theta)
17-
y2 = a*sin(theta + dt)*exp(b*theta)
15+
x2 = a*np.cos(theta + dt)*np.exp(b*theta)
16+
y2 = a*np.sin(theta + dt)*np.exp(b*theta)
1817

19-
xf = concatenate((x, x2[::-1]))
20-
yf = concatenate((y, y2[::-1]))
18+
xf = np.concatenate((x, x2[::-1]))
19+
yf = np.concatenate((y, y2[::-1]))
2120

22-
p1 = fill(xf, yf)
21+
p1 = plt.fill(xf, yf)
2322

24-
show()
23+
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.