How to Solve NameError: name 'FigureCanvasQTAgg' is not defined -- matplotlib

Solution: Import the 'FigureCanvasQTAgg' module

To Solve the error, add the following line to the top of your code.

from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg

 

For more information:
Python matplotlib FigureCanvasQTAgg