Browse files

deprecate undocumented `matplotlib/`

`matplotlib/` is a file which used to get imported via ipython's
`%pyplot` interface as module named `mpl`, yet it isn't clear at all
what it's role is.

Given that in our own code, and in the rest of our python neighborhood,
we often do `import matplotlib as mpl`, it's quite a bit confusing to
have something with the `mpl` name within matplotlib not be the
`matplotlib` module itself.

This module was only used in `pylab` interface, where it was simply
imported in one line via `from matplotlib import mpl` and never used
again. With the exception of, all of the modules in
were readily available simply via "import matplotlib as mpl".

pylab's functionality is retained for backwards
  • Loading branch information...
1 parent a1f8b4e commit 45b340b4b3e4a6b70a1bcf018f3d39e8f4abf7e5 @ivanov committed Nov 26, 2012
Showing with 13 additions and 1 deletion.
  1. +4 −0 CHANGELOG
  2. +5 −0 lib/matplotlib/
  3. +4 −1 lib/matplotlib/
@@ -1,3 +1,7 @@
+2012-11-26 deprecate matplotlib/, which was used only in and is
+ now replaced by the more suitable `import matplotlib as mpl`. - PI
2012-11-13 Add a symmetric log normalization class to
Also added some tests for the normalization class.
Till Stensitzki
@@ -1,3 +1,8 @@
+import warnings
+ "matplotlib.mpl is deprecated and will be removed in the next release."
+ "Please use `import matplotlib as mpl` instead",
+ DeprecationWarning)
from matplotlib import artist
from matplotlib import axis
from matplotlib import axes
@@ -219,7 +219,10 @@
from cbook import flatten, is_string_like, exception_to_str, \
silent_list, iterable, dedent
-from matplotlib import mpl # pulls in most modules
+import matplotlib as mpl
+# make module available for backwards compatability, in case folks
+# using pylab interface depended on not having to import it
from matplotlib.dates import date2num, num2date,\
datestr2num, strpdate2num, drange,\

0 comments on commit 45b340b

Please sign in to comment.