寻找绘制科学数据的框架:2d / 3d

时间:2010-05-01 04:33:14

标签: c# math charts bitmap

我需要想象一些科学计算。我通常更喜欢重新使用代码,如果已经有一个好的可用而不是每次发明轮子,这就是我要问的原因。我需要一个C#代码来绘制2d (y=f(x))和3d (z=f(x,y))数字数据集(其中任何轴可以是float,int或datetime)的图表(只需输出位图即可),有时会合并。 / p>

如果我转到here并点击左侧导航栏中的3D,我可以看到我需要的内容。但最便宜的版本售价759美元,对东欧学生的爱好项目看起来很可怕: - (

6 个答案:

答案 0 :(得分:6)

Microsoft Chart Controls是免费且非常强大的。微软购买了Dundas图表控件的权利并重新打包。这很简单吗?不,这是一个非常强大的控制。但微软也有很好的文档和samples。样本使它看起来只是bar / pie / etc类型的图表,但它也可以处理数学导向的图表。

答案 1 :(得分:1)

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 };

答案 2 :(得分:1)

开源工具:

http://plplot.sourceforge.net/index.php

但是,代码在C中。

答案 3 :(得分:0)

ZedGraph速度快,功能丰富且易于使用。它是我最喜欢的图表控件。

答案 4 :(得分:0)

plplot包可能会做你想要的。更多细节在这里: http://plplot.sourceforge.net/

答案 5 :(得分:0)

您可以在R programming language处与C#中的http://www.codeproject.com/KB/cs/RtoCSharp.aspx进行交互。

有很多图表here的示例,您可以将其转换为C#以执行您想要的操作。

相关问题