Consider this example:
import matplotlib.pyplot as plt
fig, axs = plt.subplots(1, 3, figsize=(9,3), constrained_layout=False)
[ax.plot([[0,0],[1,1]]) for ax in axs]
fig.set_facecolor('silver')
table = axs[0].table(
[[col + str(row) for col in 'ABC'] for row in range(3)],
loc='top',
)
I'd like to add a table to the top (or bottom) of a subplot and reduce this particular subplot by exactly the height of the table so that the table does not stick out, the figure does not get enlarged and all subplots have the same height (including table). I do not want to put the table into the plot area, i.e. loc='upper center'.


