{"id":8776,"date":"2021-02-07T14:43:11","date_gmt":"2021-02-07T09:13:11","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=8776"},"modified":"2026-07-13T12:32:02","modified_gmt":"2026-07-13T07:02:02","slug":"matplotlib-subplot-spacing","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/","title":{"rendered":"Matplotlib Subplot Spacing: tight_layout, constrained Layout, and GridSpec"},"content":{"rendered":"<p><strong>Quick answer:<\/strong> Matplotlib subplot spacing is a layout problem, so choose the layout tool from the figure&#8217;s needs. Start with layout=&#8217;constrained&#8217; for modern automatic placement, use fig.tight_layout() for a quick fit after adding labels, and use fig.subplots_adjust() or GridSpec when exact margins, gaps, spans, or unequal axes sizes matter. Check the saved output, not only the interactive window.<\/p>\n<figure class=\"pythonpool-article-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing.png\" alt=\"Python Pool infographic showing Matplotlib subplot spacing tight layout constrained layout manual padding and GridSpec\" width=\"1536\" height=\"1024\" loading=\"lazy\" decoding=\"async\"><figcaption>Start with constrained layout for modern figures, use tight_layout for a quick fit, and choose subplots_adjust or GridSpec when exact geometry matters.<\/figcaption><\/figure>\n<p><strong>Matplotlib subplot spacing<\/strong> controls the empty space around and between axes in the same figure. It matters when titles, tick labels, legends, colorbars, or rotated labels overlap. The best fix depends on whether you want automatic layout, exact manual control, or an interactive adjustment tool.<\/p>\n<p>For most modern plots, start with <code>layout=\"constrained\"<\/code> or <code>fig.tight_layout()<\/code>. Use <code>fig.subplots_adjust()<\/code> when you need exact margins, row gaps, or column gaps. Use <code>GridSpec<\/code> when the axes themselves need different sizes. Use <code>plt.subplot_tool()<\/code> only when you are working interactively on a desktop backend.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Quick_method_comparison\" >Quick method comparison<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Use_tight_layout_for_a_fast_automatic_fix\" >Use tight_layout() for a fast automatic fix<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Use_constrained_layout_for_complex_figures\" >Use constrained layout for complex figures<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Use_subplots_adjust_for_exact_spacing\" >Use subplots_adjust() for exact spacing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Use_GridSpec_for_uneven_subplot_layouts\" >Use GridSpec for uneven subplot layouts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Use_subplot_tool_only_for_interactive_adjustment\" >Use subplot_tool() only for interactive adjustment<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Practical_rules_for_subplot_spacing\" >Practical rules for subplot spacing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Official_Matplotlib_references\" >Official Matplotlib references<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Start_With_Constrained_Layout\" >Start With Constrained Layout<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Use_tight_layout_For_A_Quick_Fit\" >Use tight_layout For A Quick Fit<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Control_Spacing_Manually\" >Control Spacing Manually<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Use_GridSpec_For_Unequal_Axes\" >Use GridSpec For Unequal Axes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Quick_method_comparison\"><\/span>Quick method comparison<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"pythonpool-table-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<table>\n<thead>\n<tr>\n<th>Method<\/th>\n<th>Best for<\/th>\n<th>Main controls<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>fig.tight_layout()<\/code><\/td>\n<td>Automatic spacing after creating a figure<\/td>\n<td><code>pad<\/code>, <code>w_pad<\/code>, <code>h_pad<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>layout=\"constrained\"<\/code><\/td>\n<td>Automatic spacing while Matplotlib builds the figure<\/td>\n<td>Figure layout engine<\/td>\n<\/tr>\n<tr>\n<td><code>fig.subplots_adjust()<\/code><\/td>\n<td>Precise manual spacing<\/td>\n<td><code>left<\/code>, <code>right<\/code>, <code>top<\/code>, <code>bottom<\/code>, <code>wspace<\/code>, <code>hspace<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>GridSpec<\/code><\/td>\n<td>Uneven subplot sizes or custom grids<\/td>\n<td>Grid rows, columns, ratios, and subplot spans<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Use_tight_layout_for_a_fast_automatic_fix\"><\/span>Use tight_layout() for a fast automatic fix<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>tight_layout()<\/code> adjusts subplot parameters so labels and titles fit inside the figure area. It is useful when a plot is almost correct but axis labels or titles are too close to each other.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code>import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(2, 2)\nfor index, ax in enumerate(axes.flat, start=1):\n    ax.plot([1, 2, 3], [index, index + 1, index + 2])\n    ax.set_title(f\"Plot {index}\")\n    ax.set_xlabel(\"X label\")\n    ax.set_ylabel(\"Y label\")\n\nfig.tight_layout(pad=1.2)\nplt.show()<\/code><\/pre>\n<\/div>\n<p>The <code>pad<\/code> value controls padding around the figure. <code>w_pad<\/code> and <code>h_pad<\/code> can control horizontal and vertical padding separately. If your main problem is clipped labels, also see the dedicated guide to <a href=\"https:\/\/www.pythonpool.com\/matplotlib-tightlayout\/\">Matplotlib tight_layout()<\/a>.<\/p>\n<p><!-- Python Pool visual layout repair 2026-07-13 --><\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/spacing-layout-b154.png\" alt=\"Python Pool infographic showing Matplotlib subplots, axes, rows, columns, and shared figure space\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Subplot layout: Matplotlib subplots, axes, rows, columns, and shared figure space.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Use_constrained_layout_for_complex_figures\"><\/span>Use constrained layout for complex figures<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Constrained layout is usually a better automatic option for figures with colorbars, legends, suptitles, or mixed axes. It works while Matplotlib lays out the figure, so it can solve spacing problems that appear after several artists are added.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code>import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(2, 2, layout=\"constrained\")\nfor index, ax in enumerate(axes.flat, start=1):\n    ax.plot([1, 2, 3], [index, index + 1, index + 2])\n    ax.set_title(f\"Series {index}\")\n\nfig.suptitle(\"Constrained subplot layout\")\nplt.show()<\/code><\/pre>\n<\/div>\n<p>Older code may use <code>constrained_layout=True<\/code>. For new examples, <code>layout=\"constrained\"<\/code> is clear and matches current Matplotlib documentation. Avoid calling <code>tight_layout()<\/code> and constrained layout together on the same figure; pick one automatic layout system.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Use_subplots_adjust_for_exact_spacing\"><\/span>Use subplots_adjust() for exact spacing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>When automatic layout is close but not exact, <code>fig.subplots_adjust()<\/code> gives direct control over the figure margins and gaps between subplots. The most common values are <code>wspace<\/code> for width spacing between columns and <code>hspace<\/code> for height spacing between rows.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code>import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(2, 2)\nfor index, ax in enumerate(axes.flat, start=1):\n    ax.plot([1, 2, 3], [index, index + 1, index + 2])\n    ax.set_title(f\"Plot {index}\")\n\nfig.subplots_adjust(\n    left=0.08,\n    right=0.98,\n    bottom=0.08,\n    top=0.92,\n    wspace=0.35,\n    hspace=0.45,\n)\nplt.show()<\/code><\/pre>\n<\/div>\n<p>The margin values use figure-relative coordinates. For example, <code>left=0.08<\/code> means the left edge of the subplot area starts 8 percent from the left side of the figure. Increase <code>wspace<\/code> when columns are too close, and increase <code>hspace<\/code> when rows overlap.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/spacing-tight-b154.png\" alt=\"Python Pool infographic mapping subplot labels through tight_layout, padding, and bounding boxes\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>tight_layout: Subplot labels through tight_layout, padding, and bounding boxes.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Use_GridSpec_for_uneven_subplot_layouts\"><\/span>Use GridSpec for uneven subplot layouts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If the plots should not all have the same width or height, spacing alone is not enough. <code>GridSpec<\/code> lets you build a grid and place axes across rows or columns. This is useful for dashboards, side panels, or a large main plot with smaller supporting plots.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code>import matplotlib.pyplot as plt\n\nfig = plt.figure(figsize=(8, 4), layout=\"constrained\")\ngrid = fig.add_gridspec(2, 2, width_ratios=[2, 1])\n\nmain_ax = fig.add_subplot(grid[:, 0])\ntop_ax = fig.add_subplot(grid[0, 1])\nbottom_ax = fig.add_subplot(grid[1, 1])\n\nmain_ax.plot([1, 2, 3], [2, 4, 3])\ntop_ax.plot([1, 2, 3], [3, 1, 2])\nbottom_ax.plot([1, 2, 3], [1, 3, 2])\n\nplt.show()<\/code><\/pre>\n<\/div>\n<p>For deeper grid layouts, read the PythonPool guide to <a href=\"https:\/\/www.pythonpool.com\/matplotlib-gridspec\/\">Matplotlib GridSpec<\/a>. If your spacing issue is related to plot shape instead of labels, <a href=\"https:\/\/www.pythonpool.com\/matplotlib-aspect-ratio\/\">Matplotlib aspect ratio<\/a> is the next setting to check.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Use_subplot_tool_only_for_interactive_adjustment\"><\/span>Use subplot_tool() only for interactive adjustment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>plt.subplot_tool()<\/code> opens an interactive window for changing subplot margins and spacing. It is useful when you are exploring a figure locally, but it is not the best choice for notebooks, servers, CI jobs, or scripts that must run without a GUI.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code>import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(2, 2)\nplt.subplot_tool()\nplt.show()<\/code><\/pre>\n<\/div>\n<p>Once you find spacing values that work, copy those values into <code>fig.subplots_adjust()<\/code>. That makes the layout reproducible instead of depending on a manual GUI step.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Practical_rules_for_subplot_spacing\"><\/span>Practical rules for subplot spacing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Use automatic layout first when you only need labels and titles to stop overlapping. Use <code>subplots_adjust()<\/code> when you need exact margins for publication, screenshots, or matching several figures. Use <code>GridSpec<\/code> when a subplot should span more space than another subplot. When tick labels are the real issue, adjust them directly with tools such as <a href=\"https:\/\/www.pythonpool.com\/matplotlib-xticks\/\">Matplotlib xticks<\/a> and <a href=\"https:\/\/www.pythonpool.com\/matplotlib-ylim\/\">Matplotlib ylim<\/a>.<\/p>\n<p>For most 2 by 2 figures, this order works well: create the figure, add titles and labels, try <code>layout=\"constrained\"<\/code>, and then use <code>fig.subplots_adjust(wspace=..., hspace=...)<\/code> only if you still need finer control. If you are also showing grid lines, the <a href=\"https:\/\/www.pythonpool.com\/matplotlib-grid\/\">Matplotlib grid<\/a> guide covers the axis grid styling separately from subplot spacing.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/spacing-constrained-b154.png\" alt=\"Python Pool infographic comparing constrained_layout, colorbars, legends, and reserved space\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Constrained layout: Constrained_layout, colorbars, legends, and reserved space.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Official_Matplotlib_references\"><\/span>Official Matplotlib references<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/matplotlib.org\/stable\/api\/_as_gen\/matplotlib.pyplot.subplots_adjust.html\">pyplot.subplots_adjust documentation<\/a><\/li>\n<li><a href=\"https:\/\/matplotlib.org\/stable\/api\/_as_gen\/matplotlib.figure.Figure.subplots_adjust.html\">Figure.subplots_adjust documentation<\/a><\/li>\n<li><a href=\"https:\/\/matplotlib.org\/stable\/users\/explain\/axes\/tight_layout_guide.html\">Tight layout guide<\/a><\/li>\n<li><a href=\"https:\/\/matplotlib.org\/stable\/users\/explain\/axes\/constrainedlayout_guide.html\">Constrained layout guide<\/a><\/li>\n<li><a href=\"https:\/\/matplotlib.org\/stable\/api\/_as_gen\/matplotlib.pyplot.subplot_tool.html\">pyplot.subplot_tool documentation<\/a><\/li>\n<li><a href=\"https:\/\/matplotlib.org\/stable\/api\/gridspec_api.html\">GridSpec API documentation<\/a><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Start_With_Constrained_Layout\"><\/span>Start With Constrained Layout<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Constrained layout is the modern automatic layout engine and can account for axes decorations while the figure is built. Set it when creating the figure, especially when colorbars or multiple labels need room.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(2, 2, layout=\"constrained\", figsize=(7, 5))\nfor index, ax in enumerate(axes.flat, start=1):\n    ax.plot([1, 2, 3], [index, index + 1, index + 2])\n    ax.set_title(f\"Plot {index}\")\n    ax.set_xlabel(\"x label\")\n    ax.set_ylabel(\"y label\")\n<\/code><\/pre>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Use_tight_layout_For_A_Quick_Fit\"><\/span>Use tight_layout For A Quick Fit<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>tight_layout adjusts subplot parameters when it is called. Call it after adding titles, labels, and legends, and use pad, w_pad, or h_pad when the automatic result needs a little more breathing room.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(1, 2, figsize=(7, 3))\nfor ax in axes:\n    ax.plot([1, 2, 3], [2, 1, 3])\n    ax.set_xlabel(\"long x label\")\n    ax.set_title(\"A subplot title\")\nfig.tight_layout(pad=1.2, w_pad=2.0)\n<\/code><\/pre>\n<\/div>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/spacing-check-b154.png\" alt=\"Python Pool infographic testing long labels, suptitle, shared axes, savefig, and clipped output\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Spacing checks: Long labels, suptitle, shared axes, savefig, and clipped output.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Control_Spacing_Manually\"><\/span>Control Spacing Manually<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>subplots_adjust uses normalized figure coordinates and is useful when you know the exact outer margins or the gap between rows and columns. Manual settings can override the visual balance, so inspect at the target output size.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\n\nfig, axes = plt.subplots(2, 2, figsize=(6, 5))\nfor ax in axes.flat:\n    ax.imshow([[0, 1], [1, 0]])\n    ax.set_xticks([])\n    ax.set_yticks([])\nfig.subplots_adjust(left=0.08, right=0.96, bottom=0.08, top=0.92, wspace=0.18, hspace=0.28)\n<\/code><\/pre>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"Use_GridSpec_For_Unequal_Axes\"><\/span>Use GridSpec For Unequal Axes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>GridSpec describes a grid where an axes can span rows or columns and where ratios can differ. It solves a geometry problem rather than merely adding whitespace, which makes it appropriate for dashboards and plots with a main panel plus supporting panels.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">import matplotlib.pyplot as plt\nfrom matplotlib.gridspec import GridSpec\n\nfig = plt.figure(figsize=(7, 4), layout=\"constrained\")\ngrid = GridSpec(2, 3, figure=fig, width_ratios=[2, 1, 1])\nmain = fig.add_subplot(grid[:, 0])\nsmall_top = fig.add_subplot(grid[0, 1:])\nsmall_bottom = fig.add_subplot(grid[1, 1:])\nmain.set_title(\"main\")\nsmall_top.set_title(\"top\")\nsmall_bottom.set_title(\"bottom\")\n<\/code><\/pre>\n<\/div>\n<p>Matplotlib documents <a href=\"https:\/\/matplotlib.org\/stable\/api\/_as_gen\/matplotlib.figure.Figure.tight_layout.html\">Figure.tight_layout()<\/a> and the more modern <a href=\"https:\/\/matplotlib.org\/stable\/api\/layout_engine_api.html\">layout engines<\/a>. The <a href=\"https:\/\/matplotlib.org\/stable\/users\/explain\/axes\/tight_layout_guide.html\">tight-layout guide<\/a> explains padding and limitations. Related references include <a href=\"https:\/\/www.pythonpool.com\/matplotlib-tightlayout\/\">tight_layout<\/a>, <a href=\"https:\/\/www.pythonpool.com\/matplotlib-gridspec\/\">GridSpec<\/a>, and <a href=\"https:\/\/www.pythonpool.com\/matplotlib-aspect-ratio\/\">aspect ratio<\/a>.<\/p>\n<p>For related figure layout decisions, compare <a href=\"https:\/\/www.pythonpool.com\/matplotlib-tightlayout\/\">tight layout<\/a>, <a href=\"https:\/\/www.pythonpool.com\/matplotlib-gridspec\/\">GridSpec<\/a>, and <a href=\"https:\/\/www.pythonpool.com\/matplotlib-aspect-ratio\/\">aspect ratio<\/a> when arranging multiple axes.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3>How do I fix Matplotlib subplot spacing?<\/h3>\n<p>Try layout=&#8217;constrained&#8217; when creating the figure or call fig.tight_layout() after adding labels; use subplots_adjust for exact manual margins.<\/p>\n<h3>What is better, tight_layout or constrained layout?<\/h3>\n<p>Constrained layout is the more modern automatic layout engine, while tight_layout remains useful for a quick compatible adjustment.<\/p>\n<h3>How do I control horizontal and vertical gaps?<\/h3>\n<p>Use wspace and hspace with subplots_adjust or the relevant layout engine settings.<\/p>\n<h3>When should I use GridSpec?<\/h3>\n<p>Use GridSpec when subplot sizes, spans, or ratios need a custom grid rather than only more padding.<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"How do I fix Matplotlib subplot spacing?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Try layout='constrained' when creating the figure or call fig.tight_layout() after adding labels; use subplots_adjust for exact manual margins.\"}},{\"@type\":\"Question\",\"name\":\"What is better, tight_layout or constrained layout?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Constrained layout is the more modern automatic layout engine, while tight_layout remains useful for a quick compatible adjustment.\"}},{\"@type\":\"Question\",\"name\":\"How do I control horizontal and vertical gaps?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Use wspace and hspace with subplots_adjust or the relevant layout engine settings.\"}},{\"@type\":\"Question\",\"name\":\"When should I use GridSpec?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Use GridSpec when subplot sizes, spans, or ratios need a custom grid rather than only more padding.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fix Matplotlib subplot spacing with tight_layout, constrained layout, subplots_adjust, and GridSpec without clipped labels or overlapping axes.<\/p>\n","protected":false},"author":12,"featured_media":32277,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2071],"tags":[3550,3547,3548,3551,3545,3546,3549],"class_list":["post-8776","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-matplotlib","tag-adjust-spacing-between-subplot-matplotlib","tag-adjusting-subplot-spacing-matplotlib","tag-matplotlib-set-subplot-spacing","tag-matplotlib-subplot-increase-spacing","tag-matplotlib-subplot-spacing","tag-subplot-matplotlib-spacing","tag-subplot-spacing-matplotlib","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v28.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Matplotlib Subplot Spacing: tight_layout and GridSpec<\/title>\n<meta name=\"description\" content=\"Fix Matplotlib subplot spacing with tight_layout, constrained layout, subplots_adjust, and GridSpec without clipped labels or overlapping axes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Matplotlib Subplot Spacing: tight_layout, constrained Layout, and GridSpec\" \/>\n<meta property=\"og:description\" content=\"Fix Matplotlib subplot spacing with tight_layout, constrained layout, subplots_adjust, and GridSpec without clipped labels or overlapping axes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-07T09:13:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-13T07:02:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing.png\" \/>\n<meta name=\"author\" content=\"Prachee Sao\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Python Pool\" \/>\n<meta name=\"twitter:description\" content=\"Practical Python tutorials, error fixes, code examples, and project guides.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing.png\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prachee Sao\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/\"},\"author\":{\"name\":\"Prachee Sao\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/b91d749826b21e606d55cda77d51ef47\"},\"headline\":\"Matplotlib Subplot Spacing: tight_layout, constrained Layout, and GridSpec\",\"datePublished\":\"2021-02-07T09:13:11+00:00\",\"dateModified\":\"2026-07-13T07:02:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/\"},\"wordCount\":1079,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/matplotlib-subplot-spacing-featured.png\",\"keywords\":[\"adjust spacing between subplot matplotlib\",\"adjusting subplot spacing matplotlib\",\"matplotlib set subplot spacing\",\"matplotlib subplot increase spacing\",\"matplotlib subplot spacing\",\"subplot matplotlib spacing\",\"subplot spacing matplotlib\"],\"articleSection\":[\"Matplotlib\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/\",\"name\":\"Matplotlib Subplot Spacing: tight_layout and GridSpec\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/matplotlib-subplot-spacing-featured.png\",\"datePublished\":\"2021-02-07T09:13:11+00:00\",\"dateModified\":\"2026-07-13T07:02:02+00:00\",\"description\":\"Fix Matplotlib subplot spacing with tight_layout, constrained layout, subplots_adjust, and GridSpec without clipped labels or overlapping axes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/matplotlib-subplot-spacing-featured.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/matplotlib-subplot-spacing-featured.png\",\"width\":1350,\"height\":650,\"caption\":\"Matplotlib subplot spacing with tight layout subplots adjust and constrained layout\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/matplotlib-subplot-spacing\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pythonpool.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Matplotlib Subplot Spacing: tight_layout, constrained Layout, and GridSpec\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"name\":\"Python Pool\",\"description\":\"Practical Python tutorials, error fixes, code examples, and project guides.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pythonpool.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/pythonpool\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/b91d749826b21e606d55cda77d51ef47\",\"name\":\"Prachee Sao\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g\",\"caption\":\"Prachee Sao\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Matplotlib Subplot Spacing: tight_layout and GridSpec","description":"Fix Matplotlib subplot spacing with tight_layout, constrained layout, subplots_adjust, and GridSpec without clipped labels or overlapping axes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/","og_locale":"en_US","og_type":"article","og_title":"Matplotlib Subplot Spacing: tight_layout, constrained Layout, and GridSpec","og_description":"Fix Matplotlib subplot spacing with tight_layout, constrained layout, subplots_adjust, and GridSpec without clipped labels or overlapping axes.","og_url":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/","og_site_name":"Python Pool","article_published_time":"2021-02-07T09:13:11+00:00","article_modified_time":"2026-07-13T07:02:02+00:00","og_image":[{"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing.png","type":"","width":"","height":""}],"author":"Prachee Sao","twitter_card":"summary_large_image","twitter_title":"Python Pool","twitter_description":"Practical Python tutorials, error fixes, code examples, and project guides.","twitter_image":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing.png","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Prachee Sao","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/"},"author":{"name":"Prachee Sao","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47"},"headline":"Matplotlib Subplot Spacing: tight_layout, constrained Layout, and GridSpec","datePublished":"2021-02-07T09:13:11+00:00","dateModified":"2026-07-13T07:02:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/"},"wordCount":1079,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing-featured.png","keywords":["adjust spacing between subplot matplotlib","adjusting subplot spacing matplotlib","matplotlib set subplot spacing","matplotlib subplot increase spacing","matplotlib subplot spacing","subplot matplotlib spacing","subplot spacing matplotlib"],"articleSection":["Matplotlib"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/","url":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/","name":"Matplotlib Subplot Spacing: tight_layout and GridSpec","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing-featured.png","datePublished":"2021-02-07T09:13:11+00:00","dateModified":"2026-07-13T07:02:02+00:00","description":"Fix Matplotlib subplot spacing with tight_layout, constrained layout, subplots_adjust, and GridSpec without clipped labels or overlapping axes.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing-featured.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/matplotlib-subplot-spacing-featured.png","width":1350,"height":650,"caption":"Matplotlib subplot spacing with tight layout subplots adjust and constrained layout"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/matplotlib-subplot-spacing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Matplotlib Subplot Spacing: tight_layout, constrained Layout, and GridSpec"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Practical Python tutorials, error fixes, code examples, and project guides.","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/b91d749826b21e606d55cda77d51ef47","name":"Prachee Sao","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d018c3758049ab2511d0772ac1f73c338aaa8c921577f39e0f1e5716fc7efcb4?s=96&d=wavatar&r=g","caption":"Prachee Sao"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/8776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=8776"}],"version-history":[{"count":18,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/8776\/revisions"}],"predecessor-version":[{"id":41577,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/8776\/revisions\/41577"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/32277"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=8776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=8776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=8776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}