10000 Simplfy set_boxstyle Accepts section · matplotlib/matplotlib@ee964f6 · GitHub
[go: up one dir, main page]

Skip to content
< 10000 /div>

Commit ee964f6

Browse files
committed
Simplfy set_boxstyle Accepts section
Change it to something that can actually be passed by docscrape and displayed in the setp docs
1 parent 44e4427 commit ee964f6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

lib/matplotlib/patches.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,16 @@ 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+
1743+
return str([i for i in list(_styles.keys())])
1744+
1745+
17361746
class _Style(object):
17371747
"""
17381748
A base class for the Styles. It is meant to be a container class,
@@ -2313,7 +2323,8 @@ def transmute(self, x0, y0, width, height, mutation_size):
23132323
{"AvailableBoxstyles": _pprint_styles(_style_list)}
23142324

23152325
docstring.interpd.update(
2316-
AvailableBoxstyles=_pprint_styles(BoxStyle._style_list))
2326+
AvailableBoxstyles=_pprint_styles(BoxStyle._style_list),
2327+
ListBoxstyles=_simpleprint_styles(BoxStyle._style_list))
23172328

23182329

23192330
class FancyBboxPatch(Patch):
@@ -2398,7 +2409,10 @@ def set_boxstyle(self, boxstyle=None, **kw):
23982409
Without argument (or with *boxstyle* = None), it returns
23992410
available box styles.
24002411
2401-
ACCEPTS: %(AvailableBoxstyles)s
2412+
The following boxstyles are available:
2413+
%(AvailableBoxstyles)s
2414+
2415+
ACCEPTS: %(ListBoxstyles)s
24022416
24032417
"""
24042418
if boxstyle is None:

0 commit comments

Comments
 (0)
0