File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change 1
- #!/usr/bin/env python
1
+ import matplotlib .pyplot as plt
2
+ import numpy as np
2
3
3
- from pylab import *
4
-
5
- theta = arange (0 , 8 * pi , 0.1 )
4
+ theta = np .arange (0 , 8 * np .pi , 0.1 )
6
5
a = 1
7
6
b = .2
8
7
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 ):
10
9
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 )
13
12
14
- dt = dt + pi / 4.0
13
+ dt = dt + np . pi / 4.0
15
14
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 )
18
17
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 ]))
21
20
22
- p1 = fill (xf , yf )
21
+ p1 = plt . fill (xf , yf )
23
22
24
- show ()
23
+ plt . show ()
You can’t perform that action at this time.
0 commit comments