How to SaveAs

Hi,

Could someone explain me how to save plots. I have scripts which generate two plots separately.

And I would like to save both them as pdf files using terminal, however I do not know the names of neither the TCanvas nor histogram.

Though the Viewer shows that they seem to have: c_mscl_-1::TCanvas and c_mscw_-1::TCanvas under names of the Style panel.

I tried to c_mscl_-1->SaveAs(“name.pdf”); but it gave Error: Symbol c_mscl_ is not defined in current scope.

Also tried gPad->SaveAs(“name.pdf”); It did generate file, but when I opened the file, there wasn’t any plots.

Any help is extremely appreciated!

gPad->SaveAs(“name.pdf”);