Hi,
I have a 2D histogram drawn with the “COL
” option like e.g. this one:
Now I want to programmatically know the color that corresponds to e.g. z=10
. How do I do that?
I know there is an Int_t TPaletteAxis::GetValueColor(Double_t zc)
, but apparently it only works if there is a palette axis present. That is, I need to draw my histogram with the “COLZ
” option instead of “COL
”, which does not really suit my needs. I also understand that I could draw my histogram with “COLZ
”, then move the palette axis outside the visible portion of the canvas and to proceed with TPaletteAxis::GetValueColor(...)
, but this seems unnecessarily complicated.
So I was wondering if there is another way of accomplishing it. If not (yet), why is that we need a palette axis to be able to get the color of the palette? It sounds to me like this has to be a property of a palette, not its axis. An axis may or may not be present, but the palette is present anyways.
Maybe this is something that could be considered for the future versions of ROOT?
Thanks!
Please read tips for efficient and successful posting and posting code
Please fill also the fields below. Note that root -b -q
will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug
from the ROOT prompt to pre-populate a topic.
ROOT Version: 6.30/02
Platform: alma9
Compiler: does not matter