A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mpl-visual-context.readthedocs.io/en/latest/examples/panel/test_panel_axes.html below:

Panel Placement — mpl_visual_context 0.9.3 documentation

mpl_visual_context Panel Placement
/home/docs/checkouts/readthedocs.org/user_builds/mpl-visual-context/checkouts/latest/examples/panel/test_panel_axes.py:42: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect.
  fig.tight_layout()
import matplotlib.pyplot as plt

from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable

# from mpl_visual_context.axes_panel import axis_to_panels, title_to_panel
from mpl_visual_context.axes_panel import InsetDivider, AxesDivider
from mpl_visual_context.axes_panel import add_panel

fig, axs = plt.subplots(2, 2, num=1, clear=True)
fig.tight_layout()

for ax, which in zip(
    axs.flat,
    [["label"], ["ticklabels"], ["label", "ticklabels"], ["ticklabels", "label"]],
):

    ax.set_ylabel("Y-label")
    ax.set_xlabel("X-label")
    ax.set_title("Title")

    # divider = AxesDivider(ax)
    divider = InsetDivider(ax)

    ax_host = ax
    for w in which:
        ax1 = add_panel(divider, "left", w, pad=0)
        ax_host = ax1

    ax_host = ax
    for w in which:
        ax1 = add_panel(divider, "bottom", w, pad=0)
        ax_host = ax1

    add_panel(divider, "top", "title", pad=0)

fig.tight_layout()
plt.show()

Total running time of the script: (0 minutes 0.681 seconds)

Gallery generated by Sphinx-Gallery


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4