如何为 pandas 直方图设置 x 和 y 轴标签?

its*_*old 1 python pandas

你可能会认为这是谷歌可以的,但我还没有找到任何东西。

Lou*_*ies 5

pandas'plot函数使用matplotlib,因此您可以使用matplotlib函数set_xlabelset_ylabel

plot = df.plot(x="Some Data",y="Other Data",kind="hist")
plot.set_xlabel("X")
plot.set_ylabel("Y")
Run Code Online (Sandbox Code Playgroud)