gpt4 book ai didi

c# - 关于绘制等值线(C#)的任何想法?

转载 作者:太空宇宙 更新时间:2023-11-03 10:49:06 25 4
gpt4 key购买 nike

我编写了一个代码来在我的颜色图结果图片上绘制等值线。我在考虑如何改进它以更好地呈现信息。显示每个等值线值将很有趣。与此图片相同:

picture

您对在我的代码中应用有什么建议吗?还是您认为使用不同颜色的等值线并为每种等值线颜色设置一个关键部分更好?

这是我完美运行的代码。

double[] isoLineValueArray = new double[this.isoLineNumber];
double dVal = (valueMax - valueMin) / (this.isoLineNumber + 1);
double currentVal = valueMin;
for (int i = 0; i < this.isoLineNumber; i++)
{
currentVal += dVal;
isoLineValueArray[i] = currentVal;
}
for (int v = 0; v < isoLineValueArray.Length; v++)
{
// cycle though all nodes
for (int i = 0; i < nx-1 ; i++)
{
for (int j = 0; j < ny-1 ; j++)
{
dxSum4 = dxSum4 + nx;
dySum4 = dySum4 + ny;

// nodal position
centerPoint.X = (dxSum4 - startXPos) / (endXPos - startXPos) *
(double)(xAxisPosition[this.nTicks - 1] - xAxisPosition[0]) +
(double)xAxisPosition[0];
centerPoint.Y = -theSpace.TheCells[i, j, 0].YCellDimension +
(dySum4 - startYPos) / (endYPos - startYPos) *
(double)(yAxisPosition[this.nTicks - 1] - yAxisPosition[0]) +
(double)yAxisPosition[0];

// reset
dxSum4 = 0.0;
dySum4 = 0.0;

// add to line list
lineList.AddRange(myLineGenerator.DetermineLines(...));
}
}
}

最佳答案

除了具有不同颜色的等值线之外,您还可以使用具有背景颜色的关键部分和与等值线位置对应的数字,并保留单色等值线。太多的颜色可能会令人不安。

像这样,每个数字和水平线对应一个等值线位置:

suggested look of isolines

关于c# - 关于绘制等值线(C#)的任何想法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22185355/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com