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

Solution: Import the 'figure' module

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

from pylab import figure

 

For more information:
Python pylab figure