Add a subplot to the current figure. Wrapper of `.Figure.add_subplot` with a difference in behavior explained in the notes section. Call signatures:: subplot(nrows, ncols, index, **kwargs) subplot(pos, **kwargs) subplot(ax) Parameters ----------
(*args, **kwargs)
| 939 | |
| 940 | @docstring.dedent_interpd |
| 941 | def subplot(*args, **kwargs): |
| 942 | """ |
| 943 | Add a subplot to the current figure. |
| 944 | |
| 945 | Wrapper of `.Figure.add_subplot` with a difference in behavior |
| 946 | explained in the notes section. |
| 947 | |
| 948 | Call signatures:: |
| 949 | |
| 950 | subplot(nrows, ncols, index, **kwargs) |
| 951 | subplot(pos, **kwargs) |
| 952 | subplot(ax) |
| 953 | |
| 954 | Parameters |
| 955 | ---------- |
| 956 | *args |
| 957 | Either a 3-digit integer or three separate integers |
| 958 | describing the position of the subplot. If the three |
| 959 | integers are *nrows*, *ncols*, and *index* in order, the |
| 960 | subplot will take the *index* position on a grid with *nrows* |
| 961 | rows and *ncols* columns. *index* starts at 1 in the upper left |
| 962 | corner and increases to the right. |
| 963 | |
| 964 | *pos* is a three digit integer, where the first digit is the |
| 965 | number of rows, the second the number of columns, and the third |
| 966 | the index of the subplot. i.e. fig.add_subplot(235) is the same as |
| 967 | fig.add_subplot(2, 3, 5). Note that all integers must be less than |
| 968 | 10 for this form to work. |
| 969 | |
| 970 | projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \ |
| 971 | 'polar', 'rectilinear', str}, optional |
| 972 | The projection type of the subplot (`~.axes.Axes`). *str* is the name |
| 973 | of a costum projection, see `~matplotlib.projections`. The default |
| 974 | None results in a 'rectilinear' projection. |
| 975 | |
| 976 | polar : boolean, optional |
| 977 | If True, equivalent to projection='polar'. |
| 978 | |
| 979 | sharex, sharey : `~.axes.Axes`, optional |
| 980 | Share the x or y `~matplotlib.axis` with sharex and/or sharey. The |
| 981 | axis will have the same limits, ticks, and scale as the axis of the |
| 982 | shared axes. |
| 983 | |
| 984 | label : str |
| 985 | A label for the returned axes. |
| 986 | |
| 987 | Other Parameters |
| 988 | ---------------- |
| 989 | **kwargs |
| 990 | This method also takes the keyword arguments for |
| 991 | the returned axes base class. The keyword arguments for the |
| 992 | rectilinear base class `~.axes.Axes` can be found in |
| 993 | the following table but there might also be other keyword |
| 994 | arguments if another projection is used. |
| 995 | %(Axes)s |
| 996 | |
| 997 | Returns |
| 998 | ------- |