MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / update

Method update

lib/matplotlib/gridspec.py:370–405  ·  view source on GitHub ↗

Update the subplot parameters of the grid. Parameters that are not explicitly given are not changed. Setting a parameter to *None* resets it to :rc:`figure.subplot.*`. Parameters ---------- left, right, top, bottom : float or None, optional

(self, *, left=_UNSET, bottom=_UNSET, right=_UNSET, top=_UNSET,
               wspace=_UNSET, hspace=_UNSET)

Source from the content-addressed store, hash-verified

368 _AllowedKeys = ["left", "bottom", "right", "top", "wspace", "hspace"]
369
370 def update(self, *, left=_UNSET, bottom=_UNSET, right=_UNSET, top=_UNSET,
371 wspace=_UNSET, hspace=_UNSET):
372 """
373 Update the subplot parameters of the grid.
374
375 Parameters that are not explicitly given are not changed. Setting a
376 parameter to *None* resets it to :rc:`figure.subplot.*`.
377
378 Parameters
379 ----------
380 left, right, top, bottom : float or None, optional
381 Extent of the subplots as a fraction of figure width or height.
382 wspace, hspace : float or None, optional
383 Spacing between the subplots as a fraction of the average subplot
384 width / height.
385 """
386 if left is not _UNSET:
387 self.left = left
388 if bottom is not _UNSET:
389 self.bottom = bottom
390 if right is not _UNSET:
391 self.right = right
392 if top is not _UNSET:
393 self.top = top
394 if wspace is not _UNSET:
395 self.wspace = wspace
396 if hspace is not _UNSET:
397 self.hspace = hspace
398
399 for figmanager in _pylab_helpers.Gcf.figs.values():
400 for ax in figmanager.canvas.figure.axes:
401 if ax.get_subplotspec() is not None:
402 ss = ax.get_subplotspec().get_topmost_subplotspec()
403 if ss.get_gridspec() == self:
404 fig = ax.get_figure(root=False)
405 ax._set_position(ax.get_subplotspec().get_position(fig))
406
407 def get_subplot_params(self, figure=None):
408 """

Callers 2

tight_layoutMethod · 0.95
test_updateFunction · 0.95

Calls 7

valuesMethod · 0.80
_set_positionMethod · 0.80
get_subplotspecMethod · 0.45
get_gridspecMethod · 0.45
get_figureMethod · 0.45
get_positionMethod · 0.45

Tested by 1

test_updateFunction · 0.76