TF2 on a TH3 with SURF option

From: Chris Roat <>
Date: Tue, 25 Jan 2005 10:05:30 -0800


While it is possible to draw a TF2 on a TH2 as a contour plot, it seems it is not possible to draw a TF2 on a TH3 with the SURF option.

  c1= new TCanvas("c1");

  TH2* h1= new TH2F("h1","h1",1,0,20,1,0,20);   h1->Draw();
  TF2* f1= new TF2("f1","2*x",0,10,0,10);   f1->Draw("SAME");

  TH3* h2= new TH3F("h2","h2",1,0,20,1,0,20,1,0,20);   h2->Draw();
  TF2* f2= new TF2("f2","2*x",0,10,0,10);   f2->Draw("SURF2 SAME");

My goal is to be able to draw several TF2's on the same plot, each with slightly different, but possible overlapping, ranges. In fact, I see now that plotting with SURF SAME does not seem to work:

  TF2* f2= new TF2("f2","3*x",0,20,0,20);   f2->Draw("SURF");
  TF2* f= new TF2("f","2*x",0,20,0,20);
  f->Draw("SAME SURF");

I'm using ROOT 4.02/00 on Debian.

Chris Received on Tue Jan 25 2005 - 19:05:36 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET