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

Method get_position

lib/matplotlib/gridspec.py:658–672  ·  view source on GitHub ↗

Update the subplot position from ``figure.subplotpars``.

(self, figure)

Source from the content-addressed store, hash-verified

656 return self.colspan.stop == self.get_gridspec().ncols
657
658 def get_position(self, figure):
659 """
660 Update the subplot position from ``figure.subplotpars``.
661 """
662 gridspec = self.get_gridspec()
663 nrows, ncols = gridspec.get_geometry()
664 rows, cols = np.unravel_index([self.num1, self.num2], (nrows, ncols))
665 fig_bottoms, fig_tops, fig_lefts, fig_rights = \
666 gridspec.get_grid_positions(figure)
667
668 fig_bottom = fig_bottoms[rows].min()
669 fig_top = fig_tops[rows].max()
670 fig_left = fig_lefts[cols].min()
671 fig_right = fig_rights[cols].max()
672 return Bbox.from_extents(fig_left, fig_bottom, fig_right, fig_top)
673
674 def get_topmost_subplotspec(self):
675 """

Callers 2

updateMethod · 0.45
get_subplot_paramsMethod · 0.45

Calls 6

get_gridspecMethod · 0.95
get_grid_positionsMethod · 0.80
minMethod · 0.80
maxMethod · 0.80
from_extentsMethod · 0.80
get_geometryMethod · 0.45

Tested by

no test coverage detected