TPaletteAxis on top of Pad

Dear root,

when I use the option colz to plot a TH2D, I would like to display the TPaletteAxis on top of the Pad instead of the side. How can I do that?

Thanks in advance,

Create the TPaletteAxis yourself as shown in this example.


{ TCanvas *c1 = new TCanvas("c1"); gStyle->SetPalette(1); TH2F *hpal = new TH2F("hpal","",2,-1,1,2,-1,1); hpal->SetEntries(1); hpal->SetMinimum(0); hpal->SetMaximum(150); hpal->SetContour(20); hpal->Draw(); TPaletteAxis *pal = new TPaletteAxis(-0.7,-0.7,-0.65,0.95,hpal); pal->Draw(); }


thanks for the advice… I just realised I’m plotting a TF2 (sorry for the imprecission). The constructor TPaletteAxis(x1,y1,x2,y2,TF2*) doesn’t seem to exist…

Also, I forgot to mention I’d like a horizontal palette, in case it wasn’t clear in my previouse mail.

What can I do in this case?

Thanks again,

The horizontal palette is not supported yet. It is on our To-Do list.

Is it now possible to plot horizontal palette? If not, is there a JIRA ticket for this?

This possibility is not implemented. I do not think there is a Jira ticket requesting it.

Actualy, there is ROOT-2223. Should we reopen it because it seems that this request has been forgotten?

I just reopened it. Thanks.

I think it was closed because it was very old.

We are also looking for this feature, would be nice to have!

Yes, unfortunately due to more urgent matters on the working list we had no time to implement it. You are welcome to implement something and submit a pull request.