with warnings.catch_warnings(): warnings.simplefilter("ignore", UserWarning) # This raises warnings since tight layout cannot # handle gridspec automatically. We are going to # do that manually so we can filter the warning. gs1.tight_layout(fig, rect=[None, None, 0.45, None])
with warnings.catch_warnings(): # This raises warnings since tight layout cannot # handle gridspec automatically. We are going to # do that manually so we can filter the warning. warnings.simplefilter("ignore", UserWarning) gs2.tight_layout(fig, rect=[0.45, None, None, None])
# now match the top and bottom of two gridspecs. top = min(gs1.top, gs2.top) bottom = max(gs1.bottom, gs2.bottom)