Draw different histograms in one Canvas but show the same

I’m confused about the problem ,cause I draw the TCanvas right previous.And now it seems does not work. The following shows the main code about drawing:

   hs1[i] = new TH1F(Form("hs1[%d]",i),Form("hs1[%d]",i),200,6000,12000);
   hs2[i] = new TH1F(Form("hs2[%d]",i),Form("hs2[%d]",i),200,350000,550000);
   t->Draw(Form("qS1_c>>hs1[%d]",i),BaseCut && FVCut && EventCut,""); 
   t->Draw(Form("qS2B_c>>hs2[%d]",i),BaseCut && FVCut && EventCut,"");

by the way, I define the TCanvas in the begining, the histogram is a array , filled with a ‘for’ loop from i =0 to i =5.


Your problem is no very clear. Can you be more precise ? may be give a more complete example reproducing the problem ? something we can run.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.