How To Save TH1D as png?

You save the canvas or pad, not the “histogram”, using SaveAs(), see some example code here.
To put several in one canvas, you need canvas->Divide(), see the zones.C example.