Contour series
Posted: Thu Jan 27, 2005 5:05 pm
Is there a problem with contour plots or am I doing something silly.
Using Builder 5 and TChart 7 I have code similar to that below
Apologies for using a mistune of coordinate conventions!!!!!
TTeeCommander *TeeCommander1;
TChart *Contourplot;
TSurfaceSeries *Series1;
double xd,yd ;
double tempD;
int xctr, yctr;
double showaray[128][128];
// code to fill showarray goes here
Series1->Clear();
for (xctr = 0; xctr != 128; ++xctr)
{
for (yctr = 0; yctr != 128; ++yctr)
{
xd = xmin + xscale *((double)xctr); // xd runs from -1 to + 1
yd = ymin + yscale *((double)yctr); // yd also from -1 to +1
tempD = showaray[xctr][yctr];
xd = 100.0 * xd ; // these two lines
yd = 100.0 * yd ; // are needed
Series1->AddXYZ(xd, tempD, yd);
}
}
If I leave out the two lines where I increase the values of xd and yd the plot is plain wrong.
With these lines in the plot shape is accurate but obviously the x and z labels are wrong.
I have another TChart and TTeeCommander present on the same form.
Any help will be much appreciated.
Thanks
Allan
Using Builder 5 and TChart 7 I have code similar to that below
Apologies for using a mistune of coordinate conventions!!!!!
TTeeCommander *TeeCommander1;
TChart *Contourplot;
TSurfaceSeries *Series1;
double xd,yd ;
double tempD;
int xctr, yctr;
double showaray[128][128];
// code to fill showarray goes here
Series1->Clear();
for (xctr = 0; xctr != 128; ++xctr)
{
for (yctr = 0; yctr != 128; ++yctr)
{
xd = xmin + xscale *((double)xctr); // xd runs from -1 to + 1
yd = ymin + yscale *((double)yctr); // yd also from -1 to +1
tempD = showaray[xctr][yctr];
xd = 100.0 * xd ; // these two lines
yd = 100.0 * yd ; // are needed
Series1->AddXYZ(xd, tempD, yd);
}
}
If I leave out the two lines where I increase the values of xd and yd the plot is plain wrong.
With these lines in the plot shape is accurate but obviously the x and z labels are wrong.
I have another TChart and TTeeCommander present on the same form.
Any help will be much appreciated.
Thanks
Allan