I am trying to change the size of the labels on the palette when doing a 2D plot using COLZ option. I’ve tried to use the example on https://root.cern.ch/doc/master/classTPaletteAxis.html, modifying to change the text size. I see no impact. It does change Y2NDC, as shown in the original example, but not the label sizes.
TCanvas *c1 = new TCanvas("c1","c1",600,400);
TH2F *h2 = new TH2F("h2","Example of a resized palette ",40,-4,4,40,-20,20);
Float_t px, py;
for (Int_t i = 0; i < 25000; i++) {
gRandom->Rannor(px,py);
h2->Fill(px,5*py);
}
gStyle->SetPalette(1);
h2->Draw("COLZ");
gPad->Update();
TPaletteAxis *palette = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject("palette");
palette->SetLabelSize(0.15);
h2->Draw("COLZ");
_ROOT Version: 6.14/02
Platform: Mac 10.13.6
Compiler: default