How to remove the tilte of palette color

I draw a 2-D histogram with palette color. How to remove the title of palette color “Events…”? I have try palette->GetAxis()->SetTitle(""); but it can’t work. my code is as below.
void Format_palette(TH2F *hist){
TPaletteAxis palette = (TPaletteAxis)hist->GetListOfFunctions()->FindObject(“palette”);
palette->SetX1NDC(0.85);
palette->SetX2NDC(0.90);
palette->SetY1NDC(0.13);
palette->SetY2NDC(0.93);
palette->GetAxis()->SetTitle("");

}
TCanvas *canvas5=new TCanvas(“canvas5”,“canvas5”,10,30,600,600);
Format_Canvas(canvas5);
pdf_kappa2->Draw(“colz”);
canvas5->Modified();
canvas5->Update();
Format_palette(pdf_kappa2);
canvas5->Print(dir+“pdf_ratio21.png”);

pdf_kappa2->GetZaxis()->SetTitle("");

Hi couet,
This works. thank you.
Best regards.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.