How to draw the contour?
-
- Newbie
- Posts: 12
- Joined: Sun Oct 31, 2004 4:00 am
- Location: china
How to draw the contour?
HI
I have three arrays---Long, Lati, and Temperatuer.
I want to contouer on the Temperatuer.
I have done these code:
ContourSeries: TContourSeries;
.
.
.
With ContourSeries do
begin
Clear;
for i:=0 to 50 do
AddXYZ( Long,Temp ,Lati, '', clTeeColor);
end;
It doesn't work, anything wrong?
Please help me.
I have three arrays---Long, Lati, and Temperatuer.
I want to contouer on the Temperatuer.
I have done these code:
ContourSeries: TContourSeries;
.
.
.
With ContourSeries do
begin
Clear;
for i:=0 to 50 do
AddXYZ( Long,Temp ,Lati, '', clTeeColor);
end;
It doesn't work, anything wrong?
Please help me.
If you create ContourSeries in your code manually you need something like this
Do you use Chart Editor at all or maybe you do not have TChart component on your form?
Code: Select all
ContourSeries.ParentChart:=YourChart;
Do you use Chart Editor at all or maybe you do not have TChart component on your form?
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
-
- Newbie
- Posts: 12
- Joined: Sun Oct 31, 2004 4:00 am
- Location: china
For contour series you need 2d regular or irregular grid data. This is why you need two y=y(x,z) variables i.e. two for loops to populate the series. In case your data is not arranged as grid data, you'll first have to create grid data and then pass it to series using:
where i,j are data x,z grid indexes (in your case long, latt) and y[i,j] is data you're trying to plot (in your case temperature).
Code: Select all
for i := 0 to NumCellsGridX -1 do
for j := 0 to NumCellsGridZ-1 do
ContourSeries1.AddXYZ(i,y[i,j],j);
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Hi, zheng!
In your case it seems you try to plot isotherms in geographical coordinates, therefore your Lat and Long array have to produce some grid. Isn't so?
I advice you to use Chart Editor in run-time with EditChart procedure and explore your series in run-time.
In your case it seems you try to plot isotherms in geographical coordinates, therefore your Lat and Long array have to produce some grid. Isn't so?
I advice you to use Chart Editor in run-time with EditChart procedure and explore your series in run-time.
Regards, Alexander
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
=================
TeeChart Pro v8.05, Delphi 5 & Turbo Delphi Professional for Win32., Delphi & C++Builder 2009
-
- Newbie
- Posts: 12
- Joined: Sun Oct 31, 2004 4:00 am
- Location: china
Thanks for your reply,In my case I only have one temperature data at one long and one lati.But In your program, I should get all temperature data at same long and different lati.I am not sure I make it clear.I wll give one table, that will be more clear.Marjan wrote:For contour series you need 2d regular or irregular grid data. This is why you need two y=y(x,z) variables i.e. two for loops to populate the series. In case your data is not arranged as grid data, you'll first have to create grid data and then pass it to series using:where i,j are data x,z grid indexes (in your case long, latt) and y[i,j] is data you're trying to plot (in your case temperature).Code: Select all
for i := 0 to NumCellsGridX -1 do for j := 0 to NumCellsGridZ-1 do ContourSeries1.AddXYZ(i,y[i,j],j);
Now I have three datas,Table 1
Long 100 102 103 104 105 106
Lati 94 96 98 91 90 84
Temp 23 25 26 20 29 21
You require datas, Table 2
Long 100 100 100 100 100 100 102 102 102 102 102 102 103 103 103 103 103 103...
Lati 94 96 98 91 90 84 94 96 98 91 90 84 94 96 98 91 90 84...
Temp 23 X X X X X 25 X X X X X 26 X X X X X...
these X datas I miss, How to get them?
-
- Newbie
- Posts: 12
- Joined: Sun Oct 31, 2004 4:00 am
- Location: china
Well, you have produce 3D array. Better to have regular grid, i.e. without missing data, but it's not mandatory. It seems you have data only for one latitude - it's not enough for grid.
One example for you:
One example for you:
X Y Z
90 24.919 100
92 24.9392 100
94 24.9594 100
96 24.9796 100
98 24.9998 100
90 24.9372 102
92 24.9578 102
94 24.9784 102
96 24.999 102
98 25.0196 102
90 24.9554 104
92 24.9764 104
94 24.9974 104
96 25.0184 104
98 25.0394 104
90 24.9736 106
92 24.995 106
94 25.0164 106
96 25.0378 106
98 25.0592 106
90 24.9918 108
92 25.0136 108
94 25.0354 108
96 25.0572 108
98 25.079 108
For contour series having a grid data is mandatory. For missing grid points you can generate data points by using simple (linear should do the trick) interpolation. I think TeeChart demo has an example of this: check the Surface Gridding node. It moreless does exactly what you need - creates 2d grid array from arbitrary y=y(x,z) data points.9339728 wrote: Thanks for your reply,In my case I only have one temperature data at one long and one lati.But In your program, I should get all temperature data at same long and different lati.I am not sure I make it clear.I wll give one table, that will be more clear.
Now I have three datas,Table 1
Long 100 102 103 104 105 106
Lati 94 96 98 91 90 84
Temp 23 25 26 20 29 21
You require datas, Table 2
Long 100 100 100 100 100 100 102 102 102 102 102 102 103 103 103 103 103 103...
Lati 94 96 98 91 90 84 94 96 98 91 90 84 94 96 98 91 90 84...
Temp 23 X X X X X 25 X X X X X 26 X X X X X...
these X datas I miss, How to get them?
Marjan Slatinek,
http://www.steema.com
http://www.steema.com