Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78ce67d

Browse files
committed
Merge pull request #1670 from dmcdougall/deprecate_mpl
Deprecate mpl
2 parents e0325c8 + 088677c commit 78ce67d

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
This allows backends to utilize additional text attributes, like
1818
the alignment of text elements. - pwuertz
1919

20+
2012-11-26 deprecate matplotlib/mpl.py, which was used only in pylab.py and is
21+
now replaced by the more suitable `import matplotlib as mpl`. - PI
22+
2023
2012-11-16 plt.set_cmap no longer throws errors if there is not already
2124
an active colorable artist, such as an image, and just sets
2225
up the colormap to use from that point forward. - PI

doc/api/api_changes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Changes in 1.3.x
2424
:class:`~matplotlib.colorbar.ColorbarBase` allows one to control the shape
2525
of colorbar extensions.
2626

27+
* The `~matplotlib.mpl` module is now deprecated. Those who relied on this
28+
module should transition to simply using `import matplotlib as mpl`.
29+
2730
Changes in 1.2.x
2831
================
2932

lib/matplotlib/mpl.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
.. note:: Deprecated in 1.3
3+
"""
4+
import warnings
5+
from matplotlib import MatplotlibDeprecationWarning as mplDeprecation
6+
warnings.warn(
7+
"matplotlib.mpl is deprecated and will be removed in version 1.4."
8+
"Please use `import matplotlib as mpl` instead", mplDeprecation)
19
from matplotlib import artist
210
from matplotlib import axis
311
from matplotlib import axes

lib/matplotlib/pylab.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@
219219
from matplotlib.cbook import flatten, is_string_like, exception_to_str, \
220220
silent_list, iterable, dedent
221221

222-
from matplotlib import mpl # pulls in most modules
222+
import matplotlib as mpl
223+
# make mpl.finance module available for backwards compatability, in case folks
224+
# using pylab interface depended on not having to import it
225+
import matplotlib.finance
223226

224227
from matplotlib.dates import date2num, num2date,\
225228
datestr2num, strpdate2num, drange,\

0 commit comments

Comments
 (0)