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
@@ -723,7 +723,6 @@ def subgridspec(self, nrows, ncols, **kwargs):
723
723
return GridSpecFromSubplotSpec (nrows , ncols , self , ** kwargs )
724
724
725
725
726
-
727
726
class SubplotParams :
728
727
"""
729
728
Parameters defining the positioning of a subplots grid in a figure.
@@ -761,10 +760,11 @@ def __init__(self, left=None, bottom=None, right=None, top=None,
761
760
762
761
def _repr_pretty_ (self , p : Any , cycle : bool ) -> None :
763
762
del cycle
764
- s = f"{ self .__class__ .__name__ } (left={ self .left } , bottom={ self .bottom } , right={ self .right } , top={ self .top } , "
765
- s += f"wspace={ self .wspace } , hspace={ self .hspace } )"
763
+ name = self .__class__ .__name__
764
+ s = f"{ name } (left={ self .left } , bottom={ self .bottom } , right={ self .right } , "
765
+ s += f" top={ self .top } , wspace={ self .wspace } , hspace={ self .hspace } )"
766
766
p .text (s )
767
-
767
+
768
768
def update (self , left = None , bottom = None , right = None , top = None ,
769
769
wspace = None , hspace = None , rc_default = False ):
770
770
"""
@@ -778,7 +778,8 @@ def update(self, left=None, bottom=None, right=None, top=None,
778
778
>= (top if top is not None else self .top )):
779
779
raise ValueError ('bottom cannot be >= top' )
780
780
781
- attributes = {'left' : left , 'right' : right , 'bottom' : bottom , 'top' : top , 'hspace' : hspace , 'wspace' : wspace }
781
+ attributes = {'left' : left , 'right' : right , 'bottom' : bottom , 'top' : top ,
782
+ 'hspace' : hspace , 'wspace' : wspace }
782
783
for key , value in attributes .items ():
783
784
if value is None :
784
785
if rc_default :
0 commit comments