【发布时间】:2017-01-09 17:40:31
【问题描述】:
我想在 Jupyter Notebook 上为以下 pandas 数据框绘制条形图。
| Month | number
-------------------------
0 | Apr | 6.5
1 | May | 7.3
2 | Jun | 3.9
3 | Jul | 5.1
4 | Aug | 4.1
我做到了:
%matplotlib notebook
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot')
trend_df.plot(kind='bar')
如何确保 x 轴在此处实际显示月份?
【问题讨论】:
-
在导入 matplotlib 之前,请执行
%matplotlib inline
标签: python pandas jupyter-notebook python-ggplot