void twohist() { TCanvas *c1 = new TCanvas("c1"); TH1F *h1 = new TH1F("h1","h1",10,-3,3); h1->FillRandom("gaus",10000); TExec* ex1 = new TExec("ex1","gStyle->SetErrorX(0.0);"); ex1->Draw(); //h1->GetListOfFunctions()->Add(ex1); h1->Draw("PE"); TCanvas *c2 = new TCanvas("c2"); Double_t x[] = {-3,-2,0,2,3}; TH1F *h2 = new TH1F("h2","h2",4,x); h2->FillRandom("gaus",10000); TExec* ex2 = new TExec("ex2","gStyle->SetErrorX(0.5);"); ex2->Draw(); //h2->GetListOfFunctions()->Add(ex2); h2->Draw("PE"); }