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;
}
}
有些事情我不明白是「峯」數學方程式(什麼是它的目的,它是如何得出的?) 另一件事我不明白輪廓本身是如何派生的。