Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6397fe9

Browse filesBrowse files
committed
Merge pull request #2166 from dmcdougall/warn_anchortext
[SPRINT] Add warning for mixing AnchoredText with bad kwarg
2 parents a69074e + bff7ef5 commit 6397fe9
Copy full SHA for 6397fe9

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed

‎lib/matplotlib/offsetbox.py

Copy file name to clipboardExpand all lines: lib/matplotlib/offsetbox.py
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717

1818
from __future__ import print_function
19+
import warnings
1920
import matplotlib.transforms as mtransforms
2021
import matplotlib.artist as martist
2122
import matplotlib.text as mtext
@@ -1098,6 +1099,12 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
10981099
other keyword parameters of AnchoredOffsetbox are also allowed.
10991100
"""
11001101

1102+
propkeys = prop.keys()
1103+
badkwargs = ('ha', 'horizontalalignment', 'va', 'verticalalignment')
1104+
if set(badkwargs) & set(propkeys):
1105+
warnings.warn("Mixing horizontalalignment or verticalalignment "
1106+
"with AnchoredText is not supported.")
1107+
11011108
self.txt = TextArea(s, textprops=prop,
11021109
minimumdescent=False)
11031110
fp = self.txt._text.get_fontproperties()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.