Я не понимаю, почему подграфик в левом верхнем углу имеет другое пространство между imshow и цветовой полосой по сравнению с подзаголовком в правом верхнем углу.
А еще я не понимаю, почему цветовая полоса внизу не совпадает с полосой в правом верхнем углу.
Можете ли вы это объяснить?< /p>
Код: Выделить всё
import matplotlib.pyplot as plt
import numpy as np
matrix = np.random.rand(100, 100)
mosaic = "AB;CC"
fig = plt.figure(layout="constrained")
ax_dict = fig.subplot_mosaic(mosaic)
img = ax_dict['A'].imshow(matrix, aspect="auto")
fig.colorbar(img, ax=ax_dict['A'])
img = ax_dict['B'].imshow(matrix, aspect="auto")
fig.colorbar(img, ax=ax_dict['B'])
img = ax_dict['C'].imshow(matrix, aspect="auto")
fig.colorbar(img, ax=ax_dict['C'])
plt.show()

Подробнее здесь: https://stackoverflow.com/questions/789 ... -colorbars