How to get the GridSpec from Axes in PyPlot?

ax.get_gridspec()

Know more: