Python 给出一个简单的熊猫系列,什么';创建柱状图(条形图)的简单方法是什么?

Python 给出一个简单的熊猫系列,什么';创建柱状图(条形图)的简单方法是什么?,python,pandas,numpy,matplotlib,histogram,Python,Pandas,Numpy,Matplotlib,Histogram,我有这样一个超级简单的系列: hour 0 438 1 444 2 351 3 402 4 473 5 498 6 440 7 431 8 259 9 11 11 52 12 62 13 77 14 55 22 40 23 162 Name: value, dtype: int64 它只是一个小时内观察到的事物的数量的计数。如何在Jupyter笔记本中快速、轻松地绘制

我有这样一个超级简单的系列:

hour
0     438
1     444
2     351
3     402
4     473
5     498
6     440
7     431
8     259
9      11
11     52
12     62
13     77
14     55
22     40
23    162
Name: value, dtype: int64

它只是一个小时内观察到的事物的数量的计数。如何在Jupyter笔记本中快速、轻松地绘制直方图?第一个存储箱的时间为0到1小时(00:00到01:00),第二个存储箱的时间为1到2小时(01:00到02:00),依此类推。

如果需要标准条形图:

In [8]: import matplotlib
   ...: matplotlib.style.use('ggplot')
   ...:

In [9]: s.plot.bar(rot=0, grid=True, width=1, alpha=0.7)
Out[9]: <matplotlib.axes._subplots.AxesSubplot at 0xaaab7f0>
[8]中的
:导入matplotlib
…:matplotlib.style.use('ggplot')
...:
在[9]中:s.plot.bar(rot=0,grid=True,width=1,alpha=0.7)
出[9]:

你是说一个简单的条形图:
ser.plot.bar()
s.plot(kind='bar')
?看看
matplotlib
或我个人最喜欢的
seaborn
你使用的pandas/matplotlib是什么版本的?我的默认ggplot样式看起来总是好像传递了
color='r'
参数。旁注,我总是在绘图中添加
edgecolor='k'
参数,以便在绘图之间添加一条黑线bars@MattR,pandas:0.21.0,matplotlib:2.1.0。您是否尝试执行我的答案“按原样”中的片段?注意:Seaborn的旧版本在执行
import Seaborn
后更改了设置,因此您可能希望关闭ipython/Jupyter并执行我的代码段,而不是先导入Seaborn我实际上没有在此计算机上安装Seaborn(工作)。有趣的是,风格仍然不同。。