I am importing matplotlib the following way:
import matplotlib.pyplot as plt
Then when I execute the command:
fig = plt.figure(figsize=(10, 10))
I get the following error:
TypeError: 'module' object is not callable
I don't understand why it could be happening, as I always import pyplot like that and I never have any issues.
When printing plt I obtain the following:
<module 'matplotlib' from 'C:\\Users\\itsas\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\matplotlib\\__init__.py'>
When I substitute all my 'plt' for 'matplotlib.pyplot', it works... It's almost as if it wasn't importing pyplot for some reason...
import pylab; print pylab.__file__return ?plt.figure = ...either somewhere earlier in your code, or in an interactive environment. Try restarting your environment.