In my code,
TCanvas* c = new TCanvas("cw0", "cw0", 1200, 600);
c->Divide(2, 1);
TH2F *hep_xy = new TH2F("hep_xy","hep_xy", 16, 0, 15, 16, 0, 15);
TH1F *hep = new TH1F("hep", "hep", 200, 0, 200);
c->cd(1);
hep_xy->Draw("colz");
hep_xy->GetXaxis()->SetTitle("X ");
hep_xy->GetYaxis()->SetTitle("Y");
hep_xy->GetXaxis()->CenterTitle();
hep_xy->GetYaxis()->CenterTitle();
c->cd(2);
hep->Draw();
hep->GetXaxis()->SetTitle("number");
hep->GetYaxis()->SetTitle("Count");
hep->GetXaxis()->CenterTitle();
hep->GetYaxis()->CenterTitle();
c->Update();
c->SaveAs(./hep.png);
The png file it saves is only 0kB, and the pdf file is normal。
__
Please read tips for efficient and successful posting and posting code
ROOT Version: root-6.13.02
Platform: Not Provided
Compiler: Not Provided