自动推断时间序列图的比例
问题:
我正在绘制一个时间序列。我不知道先验的最小值和最小值最大值。我想绘制最后 5 秒的数据。我希望绘图能够自动重新调整自身比例,以最适合过去五秒的数据。然而,我不希望重新缩放变得不稳定(因为人们会通过不断重置最小值和最大值来实现)——当它重新缩放时,我希望重新缩放是平滑的。
是否有任何现有的算法可以处理这个问题?
形式上:
我有一个函数
float Sample();
您可以多次调用。我希望您能够不断地、实时地向我绘制最后 5 * 60 个值,并且图表的比例很好。我希望图表自动重新缩放;但不是以“生涩”的方式。
谢谢!
Problem:
I am plotting a time series. I don't know apriori the minimum & maximum values. I want to plot it for the last 5 seconds of data. I want the plot to automaticaly rescale itself to best fit the data for the past five seconds. However, I don't want the rescaling to be jerky (as one would get by constantly resetting the min & max) -- when it does rescale, I want the rescaling to be smooth.
Are there any existing algorithms for handling this?
Formally:
I have a function
float sample();
that you can call multiple times. I want you to constantly, in real time, plot the last 5 * 60 values to me, with the chart nicely scaled. I want the chart to automatically rescale; but not in a "jerky" way.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试类似的方法并降低调整速度。
如果太不稳定,
You could try something like
And lower the adjustSpeed if it's too jerky.