5.5 Pandas画图
5.5 Pandas画图
学习目标
- 了解DataFrame的画图函数
- 了解Series的画图函数
1 pandas.DataFrame.plot
DataFrame.plot(kind='line')
kind : str,需要绘制图形的种类
- ‘line’ : line plot (default)
- ‘bar’ : vertical bar plot
- ‘barh’ : horizontal bar plot
- 关于“barh”的解释:
- http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.barh.html
- ‘hist’ : histogram
- ‘pie’ : pie plot
- ‘scatter’ : scatter plot
更多细节:https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.plot.html?highlight=plot#pandas.DataFrame.plot
2 pandas.Series.plot
更多细节:https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.plot.html?highlight=plot#pandas.Series.plot