10000 Merge pull request #3954 from jenshnielsen/accepts_issue · matplotlib/matplotlib@a1fdaed · GitHub
[go: up one dir, main page]

Skip to content

Commit a1fdaed

Browse files
committed
Merge pull request #3954 from jenshnielsen/accepts_issue
DOC : Simplify set_boxstyle Accepts section of FancyBboxPatch
2 parents 67d4bd7 + ed64871 commit a1fdaed

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

lib/matplotlib/patches.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,18 @@ def _pprint_styles(_styles):
17331733
return _pprint_table(_table)
17341734

17351735

1736+
def _simpleprint_styles(_styles):
1737+
"""
1738+
A helper function for the _Style class. Given the dictionary of
1739+
(stylename : styleclass), return a string rep of the list of keys.
1740+
Used to update the documentation.
1741+
"""
1742+
styles = "[ \'"
1743+
styles += "\' | \'".join(str(i) for i in sorted(_styles.keys()))
1744+
styles += "\' ]"
1745+
return styles
1746+
1747+
17361748
class _Style(object):
17371749
"""
17381750
A base class for the Styles. It is meant to be a container class,
@@ -2313,7 +2325,8 @@ def transmute(self, x0, y0, width, height, mutation_size):
23132325
{"AvailableBoxstyles": _pprint_styles(_style_list)}
23142326

23152327
docstring.interpd.update(
2316-
AvailableBoxstyles=_pprint_styles(BoxStyle._style_list))
2328+
AvailableBoxstyles=_pprint_styles(BoxStyle._style_list),
2329+
ListBoxstyles=_simpleprint_styles(BoxStyle._style_list))
23172330

23182331

23192332
class FancyBboxPatch(Patch):
@@ -2398,7 +2411,10 @@ def set_boxstyle(self, boxstyle=None, **kw):
23982411
Without argument (or with *boxstyle* = None), it returns
23992412
available box styles.
24002413
2401-
ACCEPTS: %(AvailableBoxstyles)s
2414+
The following boxstyles are available:
2415+
%(AvailableBoxstyles)s
2416+
2417+
ACCEPTS: %(ListBoxstyles)s
24022418
24032419
"""
24042420
if boxstyle is None:

0 commit comments

Comments
 (0)
0