matplotlib.backends.backend_tkagg is throwing an attribute error for 'blit'

Viewed 1228

When I try to run python3 module_7.py on my terminal, I get the following error:

  File "/opt/CarlaSimulator/PythonClient/live_plotter.py", line 227, in plot_figure
    tkagg.blit(photo, fca.get_renderer()._renderer, colormode=2)
AttributeError: module 'matplotlib.backends.backend_tkagg' has no attribute 'blit'

I have checked the matplotlib installation and everything seems fine. This problem arises when using the CARLA simulator. There were a couple of suggested fixes like adding the backend_tkagg import before the pyplot import but it didn't fix the problem.

1 Answers

It seems that matplotlib has changed some things. According to the documentation you should use tkagg.FigureCanvasTkAgg.blit instead of tkagg.blit (assuming that you import matplotlib.backends.backend_tkagg as tkagg).

Related