I know that I can use plt.subplots()
to get handles for Figure and subplots at the same time, but how to get all subplots (or specific subplot) of an existing Figure instance?
If figure
is a Figure instance you can get the axes inside it via
allaxes = fig.get_axes()
The return of this (allaxes
) is a list of all the axes inside the figure. Which subplot is which in this list, you need to know from the figure or some other source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With