@@ -750,22 +750,22 @@ def __init__(self, left=None, bottom=None, right=None, top=None,
750
750
751
751
Parameters
752
752
----------
753
- left : float
753
+ left : float, optional
754
754
The position of the left edge of the subplots,
755
755
as a fraction of the figure width.
756
- right : float
756
+ right : float, optional
757
757
The position of the right edge of the subplots,
758
758
as a fraction of the figure width.
759
- bottom : float
759
+ bottom : float, optional
760
760
The position of the bottom edge of the subplots,
761
761
as a fraction of the figure height.
762
- top : float
762
+ top : float, optional
763
763
The position of the top edge of the subplots,
764
764
as a fraction of the figure height.
765
- wspace : float
765
+ wspace : float, optional
766
766
The width of the padding between subplots,
767
767
as a fraction of the average Axes width.
768
- hspace : float
768
+ hspace : float, optional
769
769
The height of the padding between subplots,
770
770
as a fraction of the average Axes height.
771
771
"""
@@ -796,3 +796,12 @@ def update(self, left=None, bottom=None, right=None, top=None,
796
796
self .wspace = wspace
797
797
if hspace is not None :
798
798
self .hspace = hspace
799
+
800
+ def reset (self ):
801
+ """Restore the subplot positioning parameters to the default rcParams values"""
802
+ for key in self .to_dict ():
803
+ setattr (self , key , mpl .rcParams [f'figure.subplot.{ key } ' ])
804
+
805
+ def to_dict (self ):
806
+ """Return a copy of the subplot parameters as a dict."""
807
+ return self .__dict__ .copy ()
0 commit comments