[ROOT] Draw *only* the color palette for a cont4z

Hi Rooters,

I wish to draw a 4x4 grid of histograms. On the right of the 4x4 grid I wish to draw the color palette (color scale) used in all 16 histograms (they are forced to be the same).

Please see the attached script which provides an almost minimal example of what I am trying to do.

In the script setting method=poor displays what I wish to display. However, I would like to switch to method=good, and simply draw the color palette in a separate TPad. (Or clone a copy from somewhere, etc).


fourbyfour.cxx (3.03 KB)

Hi Kevin,

I suggest a simplification of your code as shown in the attached file.

fourbyfour.cxx (2.74 KB)

Fantastic. Thank you Rene.

For future reference, if one arrives here via a search.

If the histogram is drawn on a subpad that has gPad->SetLogz(1):
You will want to set gPad->SetLogz(1) on the canvas or subpad that you draw the TPaletteAxis on.