It's a bit confusing to have a proper module have such a short, non-descriptive name.
Looking at code that uses it, if one were to see from matplotlib import cm - they'd be left wondering what those two letters could possibly stand for. Then further down, they'd see it being used with a keyword argument that would shed some light, such as cmap = cm.RdBu, and they would maybe go through the steps of "oh, it's a map... probably a color map"...maybe...
If the import code was written as from matplotlib import colormaps as cm, it'd be more clear. We would retain the dangling plt.cm and have a dummy matplotlib.cm module which would just import everything from matplotlib.colormaps.
as a bonus, I think plt.colormaps should be retained, but the code and documentation for it should live inside this new colormaps module.
It's a bit confusing to have a proper module have such a short, non-descriptive name.
Looking at code that uses it, if one were to see
from matplotlib import cm- they'd be left wondering what those two letters could possibly stand for. Then further down, they'd see it being used with a keyword argument that would shed some light, such ascmap = cm.RdBu, and they would maybe go through the steps of "oh, it's a map... probably a color map"...maybe...If the import code was written as
from matplotlib import colormaps as cm, it'd be more clear. We would retain the danglingplt.cmand have a dummymatplotlib.cmmodule which would just import everything frommatplotlib.colormaps.as a bonus, I think
plt.colormapsshould be retained, but the code and documentation for it should live inside this new colormaps module.