1

I have dataframe named df, and I have successfully plot the bar plot by issuing this command below:

df.plot(kind="bar")

The graph is displayed, however, I have no idea on how to set the x label, y label and its title? Any idea on this? Is there any full fledge documentation available for this?

Thanks for your kind advise!

4

1 回答 1

0

我假设您正在使用熊猫。数据框绘图方法返回一个 matplotlib 坐标区对象。您可以调用轴方法来自定义 - http://matplotlib.org/api/axes_api.html

ax = df.plot(kind='bar')
ax.set_xlabel('fred')
ax.set_ylabel('barney')
ax.set_title('wilma')
于 2013-09-22T12:27:08.433 回答