import matplotlib.pyplot as plt
import pandas as pd
df= pd.DataFrame({'A':['a','b'],'B':[1,2],'C':[1,2]})
fig,ax = plt.subplots()
ax.set_title("title")
ax.set_xlabel('label')
plt.xticks([])
plt.yticks([])
tab = ax.table(rowLabels=range(1,3),colLabels=['A','B','C'],cellText=df.values,loc='center',rowLoc='center')
plt.show()
##My doubt:
function_that_resize_the_box_height( function_that_get_the_table_height(tab) )
That is what i mean by 'box: