You are saving those 3 canvases to the file, that’s why I kept them. Do you still want that? If you want to save them but then close them automatically you can check this https://root-forum.cern.ch/t/solved-canvas-wont-close/4310
Or describe more precisely what you need. If you only want the 3 plots in one canvas (“C”), then you need to remove all the things with c1, c2 and c3 and just draw h_1, h_2 and h_3 directly to C (of course keeping C->cd(1), etc…).