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)
| 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 | |
| 741 | class SubplotParams: |