|
18 | 18 |
|
19 | 19 | import numpy as np
|
20 | 20 |
|
21 |
| -import matplotlib.transforms as mtransforms |
| 21 | +from matplotlib import cbook, docstring, rcParams |
22 | 22 | import matplotlib.artist as martist
|
23 |
| -import matplotlib.text as mtext |
24 | 23 | import matplotlib.path as mpath
|
25 |
| -from matplotlib.transforms import Bbox, BboxBase, TransformedBbox |
26 |
| - |
| 24 | +import matplotlib.text as mtext |
| 25 | +import matplotlib.transforms as mtransforms |
27 | 26 | from matplotlib.font_manager import FontProperties
|
28 |
| -from matplotlib.patches import FancyBboxPatch, FancyArrowPatch |
29 |
| -from matplotlib import rcParams |
30 |
| - |
31 |
| -from matplotlib import docstring |
32 |
| - |
33 | 27 | from matplotlib.image import BboxImage
|
34 |
| - |
35 |
| -from matplotlib.patches import bbox_artist as mbbox_artist |
| 28 | +from matplotlib.patches import ( |
| 29 | + FancyBboxPatch, FancyArrowPatch, bbox_artist as mbbox_artist) |
36 | 30 | from matplotlib.text import _AnnotationBase
|
| 31 | +from matplotlib.transforms import Bbox, BboxBase, TransformedBbox |
37 | 32 |
|
38 | 33 |
|
39 | 34 | DEBUG = False
|
@@ -1249,8 +1244,10 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
|
1249 | 1244 | prop = {}
|
1250 | 1245 | badkwargs = {'ha', 'horizontalalignment', 'va', 'verticalalignment'}
|
1251 | 1246 | if badkwargs & set(prop):
|
1252 |
| - warnings.warn("Mixing horizontalalignment or verticalalignment " |
1253 |
| - "with AnchoredText is not supported.") |
| 1247 | + cbook.warn_deprecated( |
| 1248 | + "3.1", "Mixing horizontalalignment or verticalalignment with " |
| 1249 | + "AnchoredText is not supported, deprecated since %(version)s, " |
| 1250 | + "and will raise an exception %(removal)s.") |
1254 | 1251 |
|
1255 | 1252 | self.txt = TextArea(s, textprops=prop, minimumdescent=False)
|
1256 | 1253 | fp = self.txt._text.get_fontproperties()
|
|
0 commit comments