How to control the alignment of a table of cells on a chart?

I am currently trying to align a table of cells with gaussian colWidths:

But colWidthsit doesn't seem to work with bbox. Do you know how I can proceed?

plt.table(cellText=tableData,
                  rowLabels=rowLabels,
                  colLabels=None,loc='center',colWidths=[0.2]*5,
                  bbox=[0., -0.5,1, 0.3])
+4
source share
1 answer

Finally, I decided to suppress the x axis of my plot. I do not use bbox, and I linked the table to the plot using loc = 'bottom'. Regarding cell size, I use:cell.set_width

table_prop = stats_table.properties()

table_cells = table_prop['child_artists']
for cell in table_cells: 

    cell.set_width((z2-z1)/4.4)
    cell.set_linewidth(2) 
#needed for precision problem between line from the gaussian and line from the border of the cell

Here is the result

enter image description here

0
source

Source: https://habr.com/ru/post/1689390/


All Articles