有没有办法禁用熊猫区的插值?
我想得到一个“台阶式”面积图。
E、 g.在正常线图中,可以指定:
import pandas as pd
df = pd.DataFrame({'x':range(10)})
df.plot(drawstyle = 'steps') # this works
#df.plot(kind = 'area', drawstyle = 'steps') # this does not work
我使用的是python2.7和pandas 0.14.1。在
提前致谢。在
Tags:
据我所知,
df.plot(drawstyle="steps")
甚至不存储计算的步长顶点我想你得承认。它只是在点列表中的每个
^{pr2}$(x[i],y[i])
之后直接插入(x[i+1],y[i])
:最近,
.fill_between()
的update随matplotlib 1.5.0版一起提供,允许填充两个步骤函数之间的区域。这甚至适用于熊猫时间序列。在由于参数
step='pre'
存在,因此可以这样使用:对我来说有意义的其他关键字参数是}。在
alpha=0.3
和{对于面积,这是不可能的,但你可以使用堆积条形图得到你想要的
相关问题 更多 >
编程相关推荐