如何在python中调整直方图上的字体大小

问题描述

我使用df.hist()创建了直方图,但是以某种方式我的轴的字体大小太大了。如何调整尺寸?

Current plot output with large fonts

解决方法

像这样将轴标签大小传递给df.hist()

df.hist(xlabelsize=8,ylabelsize=10)

请参阅有关pandas.DataFrame.hist()here

的文档