3

In looking for answer to Matplotlib get subplot (axes) size? , I've realized that the ax1, ax2 variables there are of class AxesSubplot.

However, I cannot find any documentation on this anywhere - for instance:

https://matplotlib.org/3.1.1/search.html?q=axessubplot&check_keywords=yes&area=default

results with:

Your search did not match any documents

So, is AxesSubplot class properties and methods documented anywhere; and if not, which is the right source file to consult, to find its API?

0

1 Answer 1

0

An AxesSubplot is an object that is created on the fly when creating subplots in matplotlib. It hence has no documentation. But for most practical purposes it's identical to the usual Axes.

In addition it has methods of SubplotBase available.

Sign up to request clarification or add additional context in comments.

2 Comments

Many thanks, @ImportanceOfBeingErnest - great to have this documented. That was my first guess too, but I saw the Axes page has position under "Other optional keyword arguments", and I tried to print ax1.position, and got AttributeError: 'AxesSubplot' object has no attribute 'position' - which confused me, and is the reason why I ended up asking this question.
Yes, if position is an "optional keyword argument", it means Axes(..., position=...) is valid. If you click on that you are directed to the method: ax.set_position (equally you can use ax.get_position).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.