How to Solve NameError: name 'MaxNLocator' is not defined -- pylab

Solution: Import the 'MaxNLocator' module

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

from pylab import MaxNLocator

 

For more information:
Python pylab MaxNLocator