8000 Fixed a numpy broadcasting error in simple_3danim.py · radford/matplotlib@503081b · GitHub
[go: up one dir, main page]

Skip to content

Commit 503081b

Browse files
committed
Fixed a numpy broadcasting error in simple_3danim.py
1 parent 86774fc commit 503081b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/animation/simple_3danim.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ def Gen_RandLine(length, dims=2) :
1414
dims is the number of dimensions the line has.
1515
"""
1616
lineData = np.empty((dims, length))
17-
lineData[:, 0] = np.random.rand(1, dims)
17+
lineData[:, 0] = np.random.rand(dims)
1818
for index in xrange(1, length) :
1919
# scaling the random numbers by 0.1 so
2020
# movement is small compared to position.
2121
# subtraction by 0.5 is to change the range to [-0.5, 0.5]
2222
# to allow a line to move backwards.
23-
step = ((np.random.rand(1, dims) - 0.5) * 0.1)
23+
step = ((np.random.rand(dims) - 0.5) * 0.1)
2424
lineData[:, index] = lineData[:, index-1] + step
2525

2626
return lineData

0 commit comments

Comments
 (0)
0