Skip to main content
 首页 » 编程设计

c#之c#.net 数组中的平滑曲线

2024年02月23日14powertoolsteam

我有一个 int 数组,我在图表中绘制了这些值。 (使用 zedgraphcontrol)

在该曲线中,我想使用 C#.net 找到局部最大值 我的想法是平滑曲线以消除噪音。 我怎样才能找到这些地方。

非常感谢大家的回复

请您参考如下方法:

我不会尝试解决 Oleksii 在他的回答中提到的要点,但我将展示一个简单的示例,说明如何在 ZedGraph 中平滑曲线:

GraphPane myPane = zedGraphControl1.GraphPane; 
 
LineItem myLine = myPane.CurveList.AddCurve("Data", myPointPairList, Color.Blue); 
 
myLine.Line.IsSmooth = true; 
myLine.Line.SmoothTension = 0.1F; 

从 0.0F 到 1.0F 的值会影响平滑量,>1.0F 可能是不需要的。

平滑的源代码文档:http://zedgraph.sourceforge.net/documentation/html/P_ZedGraph_Line_IsSmooth.htm

Zedgraph 引用资料: