设置matplot.table里面的字体大小
时间: 2023-12-10 21:05:23 浏览: 126
可以使用`cell.set_fontsize()`方法来设置表格中单元格的字体大小,示例如下:
```python
import matplotlib.pyplot as plt
data = [['A', 'B', 'C'], [1, 2, 3], [4, 5, 6], [7, 8, 9]]
fig, ax = plt.subplots()
ax.axis('off')
ax.table(cellText=data, cellLoc='center', loc='center')
for cell in ax.tables[0].cells:
cell.set_fontsize(14)
plt.show()
```
这里将字体大小设置为14。
阅读全文
相关推荐














