I want to create Matplotlib tables to present some data and wanted to add lines for every row. I thought that axhline was exactly what I needed. However, I ran into some problems. The axline function adds a line for every row, but it isn't aligned 100% correct, so it needs some adjustments, but that seems impossible. I've tried to adjust the coordinates in the function but without any results, only when I don't work with the index it yields different yet unpredictable results. Am I doing something wrong? Can someone help me?
The code beneath loops over the number of rows and adds a line for every loop. Both snippets yield the same results (which is very weird in my opinion). I also tried ax.hline which yields the same results.
Index unadjusted:
for i in range(0, len(data)+1):
cells[i, 0]._loc = custom_allignment_first_column
cells[i, 0].set_text_props(fontproperties= fm.FontProperties(fname=font_location, size=60, weight= "semibold"))
ax.axhline(y= i, color=font_color_text)
Index adjusted:
for i in range(0, len(data)+1):
cells[i, 0]._loc = custom_allignment_first_column
cells[i, 0].set_text_props(fontproperties= fm.FontProperties(fname=font_location, size=60, weight= "semibold"))
ax.axhline(y= (i * 700000), color=font_color_text)
Many thanks in advance :D