<jupyter_start><jupyter_text>Combining two subplots using subplots and GridSpecSometimes we want to combine two subplots in an axes layout created with`~.Figure.subplots`.  We can get the `~.gridspec.GridSpec` from the axesand then remove the covered axes and fill the gap with a new bigger axes.Here we create a layout with the bottom two axes in the last column combined.See also :doc:`/tutorials/intermediate/gridspec`.<jupyter_code>import matplotlib.pyplot as plt

fig, axs = plt.subplots(ncols=3, nrows=3)
gs = axs[1, 2].get_gridspec()
# remove the underlying axes
for ax in axs[1:, -1]:
    ax.remove()
axbig = fig.add_subplot(gs[1:, -1])
axbig.annotate('Big Axes \nGridSpec[1:, -1]', (0.1, 0.5),
               xycoords='axes fraction', va='center')

fig.tight_layout()

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11858190709046455, 'fraction_numerical': 0.017114914425427872, 'mean_word_length': 4.7272727272727275, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '312848', 'license': 'MIT', 'n_tokens_mistral': 304, 'n_tokens_neox': 284, 'n_words': 91, 'path': 'matplotlib/gallery_jupyter/subplots_axes_and_figures/gridspec_and_subplots.ipynb', 'repo_name': 'kingreatwill/penter', 'size': '818'}