0

I have taken one of the solutions from this page How do I plot only a table in Matplotlib?

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

fig, ax = plt.subplots()

# hide axes
fig.patch.set_visible(False)
ax.axis('off')
ax.axis('tight')

df = pd.DataFrame(np.random.randn(10, 4), columns=list('ABCD'))

ax.table(cellText=df.values, colLabels=df.columns, loc='center')

fig.tight_layout()

plt.show()

adding this didn't make any difference to the font size

ax.table(cellText=df.values, colLabels=df.columns, loc='center',fontsize=14)

how else can I change the size?

petezurich
  • 7,683
  • 8
  • 34
  • 51
user13412850
  • 455
  • 4
  • 11

1 Answers1

0

Just add this line before plt.show:

plt.rcParams.update({'font.size': 14})
skowalak
  • 103
  • 8