You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Applications are open for the 2018 John Hunter Matplotlib Summer Fellowship. Apply now!
Version 2.2.2.post1695+gedd053d16
matplotlib
Fork me on GitHub

Table Of Contents

matplotlib.pyplot.gca

matplotlib.pyplot.gca(**kwargs)[source]

Get the current Axes instance on the current figure matching the given keyword args, or create one.

See also

matplotlib.figure.Figure.gca
The figure's gca method.

Examples

To get the current polar axes on the current figure:

plt.gca(projection='polar')

If the current axes doesn't exist, or isn't a polar one, the appropriate axes will be created and then returned.