Page 1 of 1

Creating a contour image from .csv

Posted: Wed Jun 13, 2012 10:36 am
by Jack32
I'm new to DPlot and need some assistance.

I am currently using the DPlot evaluation to make sure it can do what I need it to before we purchase it.
I am using Visual Studio 2010 and coding in C#.

I have a .csv file that has approximately 100 different x, y, and z coordinates I need to create a contour image of the points. I know I can do this because I was able to open and load the points from DPlot. I am looking to create an application in visual studio that will allow a user to select a .csv file and then it creates a contour image on the screen. I am having trouble using DPlot with C#.

All assistance is greatly appreciated

Posted: Wed Jun 13, 2012 1:59 pm
by DPlotAdmin
If you have all the DPLOTLIB distribution files, I'd suggest starting with dplotlib\csharp\test2 and plugging in code to read a file rather than generating it within the program. Please let me know if you have any problems.

Posted: Thu Jun 14, 2012 9:19 am
by Jack32
Where would I plug in the code to load the file?

Posted: Thu Jun 14, 2012 3:16 pm
by DPlotAdmin
As the first step, before assigning things like the number of points, etc.

Posted: Mon Jun 18, 2012 1:26 pm
by Jack32
I looked and have attempted to plot the data but have been unsuccessful so far. I can load my data and put all the points in separate arrays. After that I am not sure what to do with the values to plot a contour map or 3d scatter plot?

I have my data in three arrays Xarray[], Yarray[], Zarray[];
I have been trying to use DPlot_Plot8() to plot my arrays but I can't get it to work.

Posted: Mon Jun 18, 2012 5:58 pm
by DPlotAdmin
Take another look at the test2 demo in

Code: Select all

private void button2_Click
It is easiest to use a 2D array as is done in the demo. If you need/want a single dimension, then X0 goes to Array[0], Y0 to Array[1], Z0 to Array[2], X1 to Array[3], etc.