Hi
Is it possible to plot irregular data into contour plot.
The data which we are using is not a square or rectangular matrix.
eg
y-data
10 20 30 40
100 20
50 30 70 80 2
We are using contour.Add(x,y,z) overload.
"IrregularGrid" property is set to true.
The problems we are facing is when we zoom into some region the contours look disconnected.
Regards
- JS
Irregular data for contour
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Irregular data for contour
Hi JS,
Can you please attach a simple example project or post a code snippet we can run "as-is" to reproduce the problem here?
Thanks in advance.
Can you please attach a simple example project or post a code snippet we can run "as-is" to reproduce the problem here?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Irregular data for contour
Hi,
I have uploaded the ready to run sample application at "http://www.steema.net/upload"
User name : Varuser
Name of Application : ContourPlotSample.zip
1.Unzip the file.
2.run exe from debug folder.
3. Click "plot" button. (Entire data is loaded).
4. zoom some part of the series. (Check that contour is broken at many places)
We have also attached some snapshots depicting the problem.
Regards
selvakumar
I have uploaded the ready to run sample application at "http://www.steema.net/upload"
User name : Varuser
Name of Application : ContourPlotSample.zip
1.Unzip the file.
2.run exe from debug folder.
3. Click "plot" button. (Entire data is loaded).
4. zoom some part of the series. (Check that contour is broken at many places)
We have also attached some snapshots depicting the problem.
Regards
selvakumar
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Irregular data for contour
Hi selvakumar,
Which exact TeeChart for.NET version are you using? I'm not able to load the data either using latest v3 nor latest v2009 release. Should I do anything special to load the chart? Or should I wait a lot of time for it to load?
Thanks in advance.
Which exact TeeChart for.NET version are you using? I'm not able to load the data either using latest v3 nor latest v2009 release. Should I do anything special to load the chart? Or should I wait a lot of time for it to load?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Irregular data for contour
Hi Narcís,
I have uploaded the sample project "ContourPlotSample.zip" on the same site.
We are using version 3 of TeeChart library (WPF).
No the application doesn't take much time to load.
Also for your reference,In the folder we have given three files of data which are x,y and z which we add in the chart.
Regards
- Selvakumar
I have uploaded the sample project "ContourPlotSample.zip" on the same site.
We are using version 3 of TeeChart library (WPF).
No the application doesn't take much time to load.
Also for your reference,In the folder we have given three files of data which are x,y and z which we add in the chart.
Regards
- Selvakumar
Re: Irregular data for contour
Hi Narcís
Any update on this. We have already uploaded the new application.
Regards
- JS
Any update on this. We have already uploaded the new application.
Regards
- JS
Re: Irregular data for contour
Hello Selvakumar,
We think that the cause of the problem relates to data holes that you describe as possibly causing a problem. The inconsistencies in the data are easier to see if you limit the part of the chart/data you view.
For example, using your test data:
The level density for the reduced dataset shows more clearly some rectangular zones without plotted lines. We can zoom right in on one of the areas where we see the misssing plot, for example, using the following condition in place of the one we used last time:
..looking at the data that the Chart has received it shows a non-homogenous grid (ie. it doesn't have a value at all required x,z locations):
ie.
If we manually add that entry at that missing data location and re-run the Chart to test the hypothesis we'll see that it plots correctly:
eg.
Please check your data and be sure that the grid is consistent throughout, taking an x value consistently at each z location and vice-versa. If your data is irregular you'll need to take a view on how to generate values, interpolating perhaps, for the missing locations.
Regards,
Marc Meumann
We think that the cause of the problem relates to data holes that you describe as possibly causing a problem. The inconsistencies in the data are easier to see if you limit the part of the chart/data you view.
For example, using your test data:
Code: Select all
for (int i = 0; i < y.Length; i++)
{
for (int j = 0; j < y[i].Length - 1; j++)
{
float x1 = x[i][j];
float y1 = y[i][j];
float z1 = z[i][j];
//cut down the Chart to an area of interest:
if ((x1 < 2.06) && (x1 > 1.9) && (z1 > 1.46) && (z1 < 1.66)) //data zone with 'holes'
{
contour.Add(x1, Convert.ToDouble(y1), z1);
}
}
}
Code: Select all
if ((x1 > 1.960) && (x1 < 1.99) && (z1 > 1.54) && (z1 < 1.56)) //hole area zoomed
ie.
- 1.98197996616364,-0.0290703102946281,1.55173301696777
1.96242296695709,0.962698101997375,1.55173301696777
1.98197996616364,0.40219309926033,1.54195404052734
1.97220098972321,0.352497905492783,1.54195404052734
1.96242296695709,0.195936396718025,1.54195404052734
If we manually add that entry at that missing data location and re-run the Chart to test the hypothesis we'll see that it plots correctly:
eg.
Code: Select all
contour = AddContourtoChart();
contour.Add(1.98197996616364, -0.0290703102946281, 1.55173301696777);
contour.Add(1.97220098972321, 1.0372040271759, 1.55173301696777); //<--- added missing entry
contour.Add(1.96242296695709, 0.962698101997375, 1.55173301696777);
contour.Add(1.98197996616364, 0.40219309926033, 1.54195404052734);
contour.Add(1.97220098972321, 0.352497905492783, 1.54195404052734);
contour.Add(1.96242296695709, 0.195936396718025, 1.54195404052734);
Regards,
Marc Meumann
Steema Support