@@ -750,22 +750,22 @@ def __init__(self, left=None, bottom=None, right=None, top=None,
750750
751751 Parameters
752752 ----------
753- left : float
753+ left : float, optional
754754 The position of the left edge of the subplots,
755755 as a fraction of the figure width.
756- right : float
756+ right : float, optional
757757 The position of the right edge of the subplots,
758758 as a fraction of the figure width.
759- bottom : float
759+ bottom : float, optional
760760 The position of the bottom edge of the subplots,
761761 as a fraction of the figure height.
762- top : float
762+ top : float, optional
763763 The position of the top edge of the subplots,
764764 as a fraction of the figure height.
765- wspace : float
765+ wspace : float, optional
766766 The width of the padding between subplots,
767767 as a fraction of the average Axes width.
768- hspace : float
768+ hspace : float, optional
769769 The height of the padding between subplots,
770770 as a fraction of the average Axes height.
771771 """
@@ -796,3 +796,12 @@ def update(self, left=None, bottom=None, right=None, top=None,
796796 self .wspace = wspace
797797 if hspace is not None :
798798 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