int BGITest() { TCanvas c("Canvas","Raw data rebinned",1); // = new TCanvas(); c.SetFillColor(42); c.SetGrid(); TH1F *hprofile = new TH1F("hprofile","RAW profile",250,0.,250); for(unsigned int it=0; it<250; it++) { hprofile->SetBinContent(it+1,1.); } hprofile->Rebin(2); // replace by sliding window (as Ana did) hprofile->Draw(); // this works: c.SaveAs("hprofile.gif"); c.Update(); c.Paint(); c.Draw(); c.Modified(); // waiting for the key to be pressed: cin.get(); return 0; }