我需要可视化一些科学计算。如果已经有很好的代码可用,我通常更喜欢重用代码,而不是每次都发明轮子,这就是我问的原因。我需要一个C#代码来绘制二维(y=f(x))
和三维(z=f(x,y))
数字数据集(其中任何轴可以是浮点数,整型或日期时间)的图表(只输出一个位图是ok),有时组合。
如果我转到here并单击左侧导航栏中的3D,就可以看到我需要的内容。但最便宜的版本要花759美元,对于一个东欧学生的爱好项目来说,看起来很可怕:-(
发布于 2010-05-01 12:47:52
Microsoft Chart Controls是免费的,而且非常强大。微软购买了Dundas图表控件的权利并对其进行了重新打包。是不是很简单?不,这是一个非常强大的控件。但微软也有很好的文档和samples。示例使它看起来像是条形图/饼图/等类型的图表,但它也可以处理面向数学的图表。
发布于 2013-09-23 22:58:00
ILNumerics非常容易学习(不幸的是,当前版本似乎不是免费的)。它将数学引擎与可视化功能(提供Windows窗体控件)相结合。以下是3D散点图的示例:
var colors
= new[] { Color.Red, Color.Black, Color.Blue, Color.Green /*...*/ };
ILArray<float> data = ILMath.zeros<float>(
3,
colors.Length);
ILArray<float> colorData = ILMath.zeros<float>(
3,
colors.Length);
int index = 0;
foreach (var p in colors)
{
data[0, index] = p.GetHue();
data[1, index] = p.GetSaturation();
data[2, index] = p.GetBrightness();
colorData [0, index] = p.R / 255.0f;
colorData [1, index] = p.G / 255.0f;
colorData [2, index] = p.B / 255.0f;
index++;
}
var points = new ILPoints()
{
Positions = data,
Colors = colorData
};
points.Color = null;
var plot = new ILPlotCube(twoDMode: false)
{
Rotation = Matrix4.Rotation(new Vector3(1, 1, 0.1f), 0.4f),
Projection = Projection.Orthographic,
Children = { points }
};
plot.Axes[0].Label.Text = "Hue";
plot.Axes[1].Label.Text = "Saturation";
plot.Axes[2].Label.Text = "Brightness";
this.ilPanel1.Scene = new ILScene { plot };
发布于 2014-12-04 13:09:16
开源工具:
http://plplot.sourceforge.net/index.php
然而,代码是用C编写的。
https://stackoverflow.com/questions/2748897
复制相似问题