Hi,
This is probably a trivial problem and the solution may already be known.
I see that there is a problem in filling small values in TGraph2D. I write here two sets of codes which can show the problem. [1] is with the normal values and works. [2] is with values scaled by 10^-4 and 10^-7.
In [2] you can see that the gaussian structure is not visible and only flat surface is visible.
I tried changing the range of the axis, but it doesnt work.
Does anyone have a fix to it?
ROOT Version: 6.22/08
Thanks
Shilpi
[1] Working one
{
TCanvas *c = new TCanvas("c","Graph2D example",0,0,600,400);
Double_t x, y, z, P = 6.;
Int_t np = 200;
TGraph2D *dt = new TGraph2D();
dt->SetTitle("Graph title; X axis title; Y axis title; Z axis title");
TRandom *r = new TRandom();
for (Int_t N=0; N<np; N++) {
x = 2*P*(r->Rndm(N))-P;
y = 2*P*(r->Rndm(N))-P;
z = (sin(x)/x)*(sin(y)/y)+0.2;
dt->SetPoint(N,x,y,z);
}
gStyle->SetPalette(1);
dt->Draw("surf1");
return c;
}
[2]
When filled with small values
{
TCanvas *c = new TCanvas("c","Graph2D example",0,0,600,400);
Double_t x, y, z, P = 6.;
Int_t np = 200;
TGraph2D *dt = new TGraph2D();
dt->SetTitle("Graph title; X axis title; Y axis title; Z axis title");
TRandom *r = new TRandom();
for (Int_t N=0; N<np; N++) {
x = 2*P*(r->Rndm(N))-P;
y = 2*P*(r->Rndm(N))-P;
z = (sin(x)/x)*(sin(y)/y)+0.2;
dt->SetPoint(N,x*10e-4,y*10e-7,z);
}
gStyle->SetPalette(1);
dt->Draw("surf1");
return c;
}

