How to remove line on the fitting plane

ROOT Version: 6.22/08
Platform: Ubuntu20.04

Dear experts,
I try to remove the red line on the fitting plane as shown on the plot below, but I have no idea about it,
could you please help me, thanks very much.
The code is also attached.

rr.C (628 Bytes)
fitting

Best regards,
Jiechen

Dear Jiechen,

I add in the loop @couet , who will know how to address this.

Best,
D

Thank you, Danilo.

@couet, hi, Couet. I don’t know how to remove the red line shown on plot, could you please help me check it? Thank you very much.

Best regards,
Jiechen

I am looking at it. I do not know yet.

This is the contour level of the fit. I do not really know wht it shows up n that case only. But you can remove it with:

   f1->SetLineColorAlpha(2,0.);

Hi, Couet,
Thank you for helping, I try to use your way, but it does work whatever adding in any line.
Is something wrong in the attached code?
rr.C (745 Bytes)

Best regards,
Jiechen

Ah yes sorry, transparency does not work on all platforms. Better do:

double fitf(Double_t *x,Double_t *par){
   double fitval=(par[0]*x[0]+par[1]*x[1]+par[2]);
   return fitval;
}

void rr()
{
   const int bin = 40;
   auto c = new TCanvas("c","c",800,600);
   auto h = new TH3F("h","h",bin,0,50,bin,0,50,bin,0,50);
   TRandom ran;
   double nn = 22;
   for (int i=0; i<5000; i++) {
      h->Fill(ran.Poisson(nn),ran.Poisson(nn),ran.Poisson(10)+10);
   }
   auto f1 = new TF2("f1",fitf,0,50,0,50,3);
   f1->SetLineWidth(0.);
   f1->SetParameters(1,1,10);
   f1->SetMinimum(0);
   f1->SetMaximum(50);

   h->Fit(f1);
   f1->Draw("surf2");
   h->Draw("same BOX2 Z");
}

Hi, Couet,
It works based on your way, thank you very much.

Best regards,
Jiechen