Tutorial :Looking for framework for plotting scientific data: 2d/3d [closed]


I need to visualize some scientific calculations. I generally prefer reusing code if there is already a good available instead of inventing wheels each time, that's why I am asking. I need a C# code to draw charts (just outputting a bitmap is ok) of 2d (y=f(x)) and 3d (z=f(x,y)) digital data sets (where any axis can be float, int or datetime), sometimes combined.

If I go here and click 3D in the navigation bar on the left, there I can see what I need. But the cheapest version costs $759 there, looks scary for a hobby project of an east-european student :-(


The Microsoft Chart Controls are free and very powerful. Microsoft bought the rights to the Dundas chart control and repackaged it. Is it simple? No, it's a very powerful control. But Microsoft also has good documentation and samples for it. The samples make it appear to be just bar/pie/etc type charts, but it can handle math oriented charting as well.


Opensource tool :


However, the code is in C.


ILNumerics is quite easy to learn (unfortunately, seems current version is not free). It combines a mathematical engine with visualization capabilities (providing Windows Forms Controls). Here is an example of a 3D scatter plot:

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


The plplot package might do what you want. More details are here: http://plplot.sourceforge.net/


You may be able to interface to the R programming language from C# as at http://www.codeproject.com/KB/cs/RtoCSharp.aspx.

There's a lot of examples of graphs here which you may be able to convert to C# to do what you want.


ZedGraph is fast, feature rich and easy to use. its my favorite charting control.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »