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

Solution: Import the 'FormatStrFormatter' module

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

from matplotlib.ticker import FormatStrFormatter

 

For more information:
Python matplotlib FormatStrFormatter