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

Method get_subplot_params

lib/matplotlib/gridspec.py:407–428  ·  view source on GitHub ↗

Return the `.SubplotParams` for the GridSpec. In order of precedence the values are taken from - non-*None* attributes of the GridSpec - the provided *figure* - :rc:`figure.subplot.*` Note that the ``figure`` attribute of the GridSpec is always ign

(self, figure=None)

Source from the content-addressed store, hash-verified

405 ax._set_position(ax.get_subplotspec().get_position(fig))
406
407 def get_subplot_params(self, figure=None):
408 """
409 Return the `.SubplotParams` for the GridSpec.
410
411 In order of precedence the values are taken from
412
413 - non-*None* attributes of the GridSpec
414 - the provided *figure*
415 - :rc:`figure.subplot.*`
416
417 Note that the ``figure`` attribute of the GridSpec is always ignored.
418 """
419 if figure is None:
420 kw = {k: mpl.rcParams["figure.subplot."+k]
421 for k in self._AllowedKeys}
422 subplotpars = SubplotParams(**kw)
423 else:
424 subplotpars = copy.copy(figure.subplotpars)
425
426 subplotpars.update(**{k: getattr(self, k) for k in self._AllowedKeys})
427
428 return subplotpars
429
430 def locally_modified_subplot_params(self):
431 """

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
SubplotParamsClass · 0.85
copyMethod · 0.45

Tested by

no test coverage detected