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

Method subgridspec

lib/matplotlib/gridspec.py:698–738  ·  view source on GitHub ↗

Create a GridSpec within this subplot. The created `.GridSpecFromSubplotSpec` will have this `SubplotSpec` as a parent. Parameters ---------- nrows : int Number of rows in grid. ncols : int Number of columns in grid.

(self, nrows, ncols, **kwargs)

Source from the content-addressed store, hash-verified

696 return hash((self._gridspec, self.num1, self.num2))
697
698 def subgridspec(self, nrows, ncols, **kwargs):
699 """
700 Create a GridSpec within this subplot.
701
702 The created `.GridSpecFromSubplotSpec` will have this `SubplotSpec` as
703 a parent.
704
705 Parameters
706 ----------
707 nrows : int
708 Number of rows in grid.
709
710 ncols : int
711 Number of columns in grid.
712
713 Returns
714 -------
715 `.GridSpecFromSubplotSpec`
716
717 Other Parameters
718 ----------------
719 **kwargs
720 All other parameters are passed to `.GridSpecFromSubplotSpec`.
721
722 See Also
723 --------
724 matplotlib.pyplot.subplots
725
726 Examples
727 --------
728 Adding three subplots in the space occupied by a single subplot::
729
730 fig = plt.figure()
731 gs0 = fig.add_gridspec(3, 1)
732 ax1 = fig.add_subplot(gs0[0])
733 ax2 = fig.add_subplot(gs0[1])
734 gssub = gs0[2].subgridspec(1, 3)
735 for i in range(3):
736 fig.add_subplot(gssub[0, i])
737 """
738 return GridSpecFromSubplotSpec(nrows, ncols, self, **kwargs)
739
740
741class SubplotParams:

Callers 11

make_axes_gridspecFunction · 0.80
_do_layoutMethod · 0.80
test_remove_from_figureFunction · 0.80
test_constrained_layout6Function · 0.80
test_all_nestedMethod · 0.80
test_nestedMethod · 0.80
arranging_axes.pyFile · 0.80
gridspec_nested.pyFile · 0.80

Calls 1

Tested by 6

test_remove_from_figureFunction · 0.64
test_constrained_layout6Function · 0.64
test_all_nestedMethod · 0.64
test_nestedMethod · 0.64