@@ -1776,8 +1776,13 @@ def get_tightbbox(self, renderer, bbox_extra_artists=None):
1776
1776
1777
1777
@staticmethod
1778
1778
def _normalize_grid_string (layout ):
1779
- layout = inspect .cleandoc (layout )
1780
- return [list (ln ) for ln in layout .strip ('\n ' ).split ('\n ' )]
1779
+ if '\n ' not in layout :
1780
+ # single-line string
1781
+ return [list (ln ) for ln in layout .split (';' )]
1782
+ else :
1783
+ # multi-line string
1784
+ layout = inspect .cleandoc (layout )
1785
+ return [list (ln ) for ln in layout .strip ('\n ' ).split ('\n ' )]
1781
1786
1782
1787
def subplot_mosaic (self , layout , * , subplot_kw = None , gridspec_kw = None ,
1783
1788
empty_sentinel = '.' ):
@@ -1812,16 +1817,21 @@ def subplot_mosaic(self, layout, *, subplot_kw=None, gridspec_kw=None,
1812
1817
Any of the entries in the layout can be a list of lists
1813
1818
of the same form to create nested layouts.
1814
1819
1815
- If input is a str, then it must be of the form ::
1820
+ If input is a str, then it can either be a multi-line string of
1821
+ the form ::
1816
1822
1817
1823
'''
1818
1824
AAE
1819
1825
C.E
1820
1826
'''
1821
1827
1822
- where each character is a column and each line is a row.
1823
- This only allows only single character Axes labels and does
1824
- not allow nesting but is very terse.
1828
+ where each character is a column and each line is a row. Or it
1829
+ can be a single-line string where rows are separated by ``;``::
1830
+
1831
+ 'AB;CC'
1832
+
1833
+ The string notation allows only single character Axes labels and
1834
+ does not support nesting but is very terse.
1825
1835
1826
1836
subplot_kw : dict, optional
1827
1837
Dictionary with keywords passed to the `.Figure.add_subplot` call
0 commit comments