diff --git a/lib/matplotlib/gridspec.py b/lib/matplotlib/gridspec.py index 222c67d66a17..f62e4db1c582 100644 --- a/lib/matplotlib/gridspec.py +++ b/lib/matplotlib/gridspec.py @@ -255,16 +255,15 @@ def __setstate__(self, state): def update(self, **kwargs): """ - Update the current values. If any kwarg is None, default to - the current value, if set, otherwise to rc. - """ + Update the current values. + Values set to None use the rcParams value. + """ for k, v in kwargs.items(): if k in self._AllowedKeys: setattr(self, k, v) else: - raise AttributeError("%s is unknown keyword" % (k,)) - + raise AttributeError(f"{k} is an unknown keyword") for figmanager in _pylab_helpers.Gcf.figs.values(): for ax in figmanager.canvas.figure.axes: # copied from Figure.subplots_adjust