Get the current :class:`~matplotlib.axes.Axes` instance on the current figure matching the given keyword args, or create one. Examples -------- To get the current polar axes on the current figure:: plt.gca(projection='polar') If the current axes doesn't exist, or
(**kwargs)
| 915 | |
| 916 | |
| 917 | def gca(**kwargs): |
| 918 | """ |
| 919 | Get the current :class:`~matplotlib.axes.Axes` instance on the |
| 920 | current figure matching the given keyword args, or create one. |
| 921 | |
| 922 | Examples |
| 923 | -------- |
| 924 | To get the current polar axes on the current figure:: |
| 925 | |
| 926 | plt.gca(projection='polar') |
| 927 | |
| 928 | If the current axes doesn't exist, or isn't a polar one, the appropriate |
| 929 | axes will be created and then returned. |
| 930 | |
| 931 | See Also |
| 932 | -------- |
| 933 | matplotlib.figure.Figure.gca : The figure's gca method. |
| 934 | """ |
| 935 | return gcf().gca(**kwargs) |
| 936 | |
| 937 | |
| 938 | ## More ways of creating axes ## |