If I do
import matplotlib as mpl
mpl.colorbar
-> since colorbar is a submodule and not an attribute, I get the error:
'module' object has no attribute 'colorbar'
whereas if I do (add another import before that):
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.colorbar
it works, I get the
module 'matplotlib.colorbar'
How is this possible!? I mean, I see, that colorbar is a valid attribute of plt, but how does it get into the mpl? Why can something before the import in the second line modify the mpl object which is overwritten in my locals() after that?!
Even if this is matplotlib-specific, it seems my general understanding of python needs an update :)
It does not
