|
298 | 298 | _axes_format_docstring = """
|
299 | 299 | title : str, optional
|
300 | 300 | The axes title.
|
301 |
| -abc : bool or str, default: :rc:`abc` |
| 301 | +abc : bool or str or tuple, default: :rc:`abc` |
302 | 302 | The "a-b-c" subplot label style. Must contain the character ``a`` or ``A``,
|
303 | 303 | for example ``'a.'``, or ``'A'``. If ``True`` then the default style of
|
304 | 304 | ``'a'`` is used. The ``a`` or ``A`` is replaced with the alphabetic character
|
|
345 | 345 | The horizontal padding between a-b-c labels and titles in the same location.
|
346 | 346 | %(units.pt)s
|
347 | 347 | ltitle, ctitle, rtitle, ultitle, uctitle, urtitle, lltitle, lctitle, lrtitle \
|
348 |
| -: str, optional |
| 348 | +: str, tuple, optional |
349 | 349 | Shorthands for the below keywords.
|
350 | 350 | lefttitle, centertitle, righttitle, upperlefttitle, uppercentertitle, upperrighttitle, \
|
351 |
| -lowerlefttitle, lowercentertitle, lowerrighttitle : str, optional |
| 351 | +lowerlefttitle, lowercentertitle, lowerrighttitle : str, tuple, optional |
352 | 352 | Additional titles in specific positions. This works as an alternative
|
353 | 353 | to the ``ax.format(title='Title', titleloc=loc)`` workflow and permits
|
354 | 354 | adding more than one title-like label for a single axes.
|
@@ -2288,9 +2288,11 @@ def _update_abc(self, **kwargs):
|
2288 | 2288 | abc = rc.find('abc', context=True) # 1st run, or changed
|
2289 | 2289 | if abc is True:
|
2290 | 2290 | abc = 'a'
|
2291 |
| - if abc and (not isinstance(abc, str) or 'a' not in abc and 'A' not in abc): |
2292 |
| - raise ValueError(f'Invalid style {abc!r}. Must include letter "a" or "A".') |
2293 |
| - if abc and self.number is not None: |
| 2291 | + if isinstance(abc, tuple): |
| 2292 | + kw['text'] = abc[self.number - 1] |
| 2293 | + elif abc and (not isinstance(abc, str) or 'a' not in abc and 'A' not in abc): |
| 2294 | + raise ValueError(f'Invalid style {abc!r}. Must include letter "a" or "A"') |
| 2295 | + if isinstance(abc, str) and self.number is not None: |
2294 | 2296 | nabc, iabc = divmod(self.number - 1, 26)
|
2295 | 2297 | old = re.search('[aA]', abc).group() # return the *first* 'a' or 'A'
|
2296 | 2298 | new = (nabc + 1) * ABC_STRING[iabc]
|
@@ -2369,7 +2371,9 @@ def _update_title(self, loc, title=None, **kwargs):
|
2369 | 2371 | # necesssary. For inner panels, use the border and bbox settings.
|
2370 | 2372 | if loc not in ('left', 'right', 'center'):
|
2371 | 2373 | kw.update(self._title_border_kwargs)
|
2372 |
| - if title is not None: |
| 2374 | + if isinstance(title, tuple): |
| 2375 | + kw['text'] = title[self.number - 1] |
| 2376 | + elif title is not None: |
2373 | 2377 | kw['text'] = title
|
2374 | 2378 | kw.update(kwargs)
|
2375 | 2379 | self._title_dict[loc].update(kw)
|
|
0 commit comments