How to control cells table alignment on a plot?

Viewed 109

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

But colWidths seems to not work with bbox. Do you have any idea 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])
1 Answers

Finally, I decided to suppress the x axis of my plot. I haven't use bbox and I sticked the table to the plot using loc='bottom'. Concerning the size of the cell 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 the result

enter image description here

Related