1
我想从活的x-y坐标数据(使用OxyPlot)制作等高线图。OxyPlot轮廓系列
我见过使用ContourSeries
给出的例子,并且我无法理解如何实现轮廓。
下面是示例代码:
namespace ExampleLibrary
{
using System;
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;
[Examples("ContourSeries"), Tags("Series")]
public class ContourSeriesExamples
{
private static Func<double, double, double> peaks = (x, y) =>
3 * (1 - x) * (1 - x) * Math.Exp(-(x * x) - (y + 1) * (y + 1))
- 10 * (x/5 - x * x * x - y * y * y * y * y) * Math.Exp(-x * x - y * y)
- 1.0/3 * Math.Exp(-(x + 1) * (x + 1) - y * y);
[Example("Peaks")]
public static PlotModel Peaks()
{
var model = new PlotModel { Title = "Peaks" };
var cs = new ContourSeries
{
ColumnCoordinates = ArrayBuilder.CreateVector(-3, 3, 0.05),
RowCoordinates = ArrayBuilder.CreateVector(-3.1, 3.1, 0.05)
};
cs.Data = ArrayBuilder.Evaluate(peaks, cs.ColumnCoordinates, cs.RowCoordinates);
model.Subtitle = cs.Data.GetLength(0) + "×" + cs.Data.GetLength(1);
model.Series.Add(cs);
return model;
}
}
有些事情我不明白是“峰”数学方程式(什么是它的目的,它是如何得出的?) 另一件事我不明白轮廓本身是如何派生的。