Skip to content

Commit

Permalink
Apply changes from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Knyazev <[email protected]>
  • Loading branch information
rossbar and lobpcg committed Oct 17, 2024
1 parent 0483995 commit eae3070
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/3d_drawing/plot_3d_animation_walk.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def init():
ax.plot(*nodes[0], alpha=1, marker="s", color="red")
ax.grid(False)
ax.set_axis_off()
plt.tight_layout()


def _frame_update(index):
Expand All @@ -53,13 +52,14 @@ def _frame_update(index):
# Update node
node = random.choice(neighbors)
# Update the last line object, which corresponds to the walking node
pt = ax.lines[-1].set_data_3d(nodes[node][:, np.newaxis])
_ = ax.lines[-1].set_data_3d(nodes[node][:, np.newaxis])
# Update view
ax.view_init(index * 0.2, index * 0.5)


fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
fig.tight_layout()
node = 0 # Initialize the walking node
ani = animation.FuncAnimation(
fig,
Expand Down

0 comments on commit eae3070

Please sign in to comment.