From cf7ba1a968d62838a45eeec768b55849791728a2 Mon Sep 17 00:00:00 2001 From: Dago Romer Date: Thu, 28 Mar 2019 10:34:15 +0100 Subject: [PATCH] fixed bug in #13778, created description #8921 --- examples/animation/random_walk.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/animation/random_walk.py b/examples/animation/random_walk.py index b26a8a71cd13..2899f6d69c15 100644 --- a/examples/animation/random_walk.py +++ b/examples/animation/random_walk.py @@ -3,14 +3,17 @@ Animated 3D random walk ======================= +This generates 50 lines using random walk +and animates their creation in a 3D space """ import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation +from mpl_toolkits.mplot3d import Axes3D # Fixing random state for reproducibility -np.random.seed(19680801) +np.random.seed(20160425) def gen_rand_line(length, dims=2): @@ -42,7 +45,7 @@ def update_lines(num, dataLines, lines): # Attaching 3D axis to the figure fig = plt.figure() -ax = fig.add_subplot(projection="3d") +ax = fig.add_subplot(111, projection="3d") # Fifty lines of random 3-D lines data = [gen_rand_line(25, 3) for index in range(50)]