Hi,
I would like to save the graphs by ROOT, so I tried “Print” and “SaveAs” commands.
However, it creates blank png or pdf files without any error messages
even though it shows the graphs on the screen.
Would you tell me how to save the graphs?
Here is my macro,
{
…
TCanvas *fCanv[10];
Int_t *xCanDiv;
Int_t *yCanDiv;
Int_t xCanSize;
Int_t yCanSize;
…
name = Form(“Protons_”);
…
…
name += i;
fCanv[i] = new TCanvas(name.Data(), name.Data(), xCanSize, yCanSize);
fCanv[i]->SetFillColor(10);
fCanv[i]->Divide(xCanDiv[i], yCanDiv[i]);
…
fCanv[i]->SaveAs( Form( “%s%s.png”, name.Data(), Polarity.Data() ) );
fCanv[i]->Print( Form( “%s%s.pdf”, name.Data(), Polarity.Data() ) );
…
}