0

I'm using matplotlib to plot a dataframe table into a PDF file using PdfPages. The dataframe has around 75 columns and need to display each of the columns. so, I tried to add horizontal scrolling to the image.

I'm using below code:

# df is the dataframe having 75 columns.

fig, ax = plt.subplots(dpi=100)
fig, ax = plt.subplots()
ax.axis('tight')
ax.axis('off')
ax.table(cellText=df.values, colLabels=df.columns, rowLabels=df.index, loc='center', colWidths=[0.1] * 75)

I have tried adding scrolling widgets: slider, however it wasn't working out. Also, it seems: ax.table doesn't have any scrolling option by default.

Mandar Pande
  • 12,250
  • 16
  • 45
  • 72

0 Answers0