Hi.
In the missing lines there is a c2->Divide(…,…);?
If you have not used “Divide” on your TCanvas c2 you must write c2->cd(); instead of c2->cd(2); (same with c1 for style but writing on the first pad should be equalent to writing on the canvas) or ROOT will try to draw on a pad which doesn’t exist and so maybe you get only a window (the “c1”)
Maybe this will solve the problem (I don’t know if I have understood what you want to do).