Hi,
Presumably, due to an update in Matplotlib, the current version of this notebook throws an error when one tries to visualize the animal movements.
The error is in the previous cell and it can be fixed by substituting lines 86-90
fig.canvas.draw()
image_from_plot = np.frombuffer(fig.canvas.tostring_rgb(),
dtype=np.uint8)
image_from_plot = image_from_plot.reshape(
fig.canvas.get_width_height()[::-1] + (3,))
with
fig.canvas.draw()
# Convert the figure to an RGB array using `fig.canvas.tostring_rgb()` before plotting.
image_from_plot = np.frombuffer(fig.canvas.buffer_rgba(), dtype=np.uint8)
# Reshape the RGB array to the correct dimensions.
image_from_plot = image_from_plot.reshape(fig.canvas.get_width_height()[::-1] + (4,)) # RGBA
image_from_plot = image_from_plot[:, :, :3] # Convert RGBA to RGB by removing alpha channel
Hi,
Presumably, due to an update in Matplotlib, the current version of this notebook throws an error when one tries to visualize the animal movements.
The error is in the previous cell and it can be fixed by substituting lines 86-90
with