我有下面的粒度数据,我想在图表上显示,其中x是粒度,y是概率密度函数。x遵循一个几何序列(每个值乘以2)
x:[0.0,0.0781300000000000005,0.1562600000000001,0.31252000000000002,0.625040000000040004,1.25008000000001,2500800000000002,5.00032000000000003,10.000640000000001,20.001280000000001]
y:[0.0,1.0512499897262986,0.876497322043381,0.6221799472771921,0.3760124741123981,0.19346808043817057,0.08474951460350254,0.0316071940839253,0.010035880788326037,0.0]
下面是图表:
我一直在试着像Excel一样平滑曲线。我试过使用interp1d(所有方法)、spline、akima1dipolator。在
所以在我上面的评论中,我很容易地说。然而,问题在于,数据最终非常平淡。三次插值和高阶插值不喜欢平面数据。它们倾向于振荡。正如@f5r5e5d所提到的,诀窍是重新缩放数据,使扁平部分变得非常短。在这种情况下,双对数刻度似乎可以。不幸的是,这不适用于
y = 0
值。对于一个小的点,选择一个小的偏移值,或者选择一个不太小的值。在蓝色表示原始数据,橙色表示平滑插值。在
相关问题 更多 >
编程相关推荐