9
9
methods like `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` and
10
10
`~.Figure.subfigures`. See the tutorial :ref:`arranging_axes` for a guide.
11
11
"""
12
-
12
+ from typing import Any
13
13
import copy
14
14
import logging
15
15
from numbers import Integral
@@ -728,7 +728,6 @@ def subgridspec(self, nrows, ncols, **kwargs):
728
728
return GridSpecFromSubplotSpec (nrows , ncols , self , ** kwargs )
729
729
730
730
731
-
732
731
class SubplotParams :
733
732
"""
734
733
Parameters defining the positioning of a subplots grid in a figure.
@@ -766,10 +765,11 @@ def __init__(self, left=None, bottom=None, right=None, top=None,
766
765
767
766
def _repr_pretty_ (self , p : Any , cycle : bool ) -> None :
768
767
del cycle
769
- s = f"{ self .__class__ .__name__ } (left={ self .left } , bottom={ self .bottom } , right={ self .right } , top={ self .top } , "
770
- s += f"wspace={ self .wspace } , hspace={ self .hspace } )"
768
+ name = self .__class__ .__name__
769
+ s = f"{ name } (left={ self .left } , bottom={ self .bottom } , right={ self .right } , "
770
+ s += f" top={ self .top } , wspace={ self .wspace } , hspace={ self .hspace } )"
771
771
p .text (s )
772
-
772
+
773
773
def update (self , left = None , bottom = None , right = None , top = None ,
774
774
wspace = None , hspace = None , rc_default = False ):
775
775
"""
@@ -783,7 +783,8 @@ def update(self, left=None, bottom=None, right=None, top=None,
783
783
>= (top if top is not None else self .top )):
784
784
raise ValueError ('bottom cannot be >= top' )
785
785
786
- attributes = {'left' : left , 'right' : right , 'bottom' : bottom , 'top' : top , 'hspace' : hspace , 'wspace' : wspace }
786
+ attributes = {'left' : left , 'right' : right , 'bottom' : bottom , 'top' : top ,
787
+ 'hspace' : hspace , 'wspace' : wspace }
787
788
for key , value in attributes .items ():
788
789
if value is None :
789
790
if rc_default :
0 commit comments