Skip to content

Commit cbbcd23

Browse files
committed
demo: minor rearragement
1 parent 087ccf1 commit cbbcd23

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

demo.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
y_3d = (np.cos(ph) * np.sin(th)) .ravel()
1818
z_3d = (np.sin(ph) * np.ones( th.shape )) .ravel()
1919

20+
rho = np.linspace(0, 2*np.pi, 1000) # dim=( 1000,)
21+
a = np.arange(-4,3)[:, np.newaxis] # dim=(7,1)
22+
2023

2124

2225

@@ -77,10 +80,8 @@
7780
wait = 1)
7881

7982
# Conchoids of de Sluze. Broadcasting example
80-
theta = np.linspace(0, 2*np.pi, 1000) # dim=( 1000,)
81-
a = np.arange(-4,3)[:, np.newaxis] # dim=(7,1)
82-
gp.plot( theta,
83-
1./np.cos(theta) + a*np.cos(theta), # broadcasted. dim=(7,1000)
83+
gp.plot( rho,
84+
1./np.cos(rho) + a*np.cos(rho), # broadcasted. dim=(7,1000)
8485

8586
_with = 'lines',
8687
set = 'polar',
@@ -269,8 +270,8 @@
269270
# basics
270271
gp.plot( (x**2,),
271272
(-x, x**3),
272-
( theta,
273-
1./np.cos(theta) + a*np.cos(theta), # broadcasted. dim=(7,1000)
273+
( rho,
274+
1./np.cos(rho) + a*np.cos(rho), # broadcasted. dim=(7,1000)
274275

275276
dict( _with = 'lines',
276277
set = 'polar',

0 commit comments

Comments
 (0)