Reputation: 123
I have changed the spacing of my subplots successfully with the Subplot Configuration Tool (accessible in the figure window), now I would like to actually get the values of the properties I just set: hspace
, wspace
etc.
Where can I find these?
I tried plt.getp(plt.axes())
, along with other objects as argument to getp
but have had no luck in finding them so far.
Upvotes: 6
Views: 1704
Reputation: 68126
You want to use fig.subplotpars
from matplotlib import pyplot
fig, axes = pyplot.subplots(nrows=2, ncols=2)
fig.subplots_adjust(hspace=0.5)
print(fig.subplotpars.hspace, fig.subplotpars.wspace, sep='; ')
And that prints:
0.5; 0.2
Upvotes: 6