对于下面的MWE,我使用在this docs page中定义的函数.请考虑以下代码:
import matplotlib.pyplot as plt
import numpy as np
# Helper function used for visualization in the following examples
def identify_axes(ax_dict, fontsize=48):
"""
Helper to identify the Axes in the examples below.
Draws the label in a large font in the center of the Axes.
Parameters
----------
ax_dict : dict[str, Axes]
Mapping between the title / label and the Axes.
fontsize : int, optional
How big the label should be.
"""
kw = dict(ha="center", va="center", fontsize=fontsize, color="darkgrey")
for k, ax in ax_dict.items():
ax.text(0.5, 0.5, k, transform=ax.transAxes, **kw)
axd = plt.figure(layout="constrained").subplot_mosaic(
"""
AC
DD
"""
)
identify_axes(axd)
这就产生了这个数字:
Basically I'm trying to reproduce something like this figure:
我的问题是:我如何才能产生一个类似的图形,但底部的情节与其他两个具有相同的大小,并且仍然居中?不管怎么说,我都想不出这一点.