Absolute color scale in 2D plots

Hi,
as far as I know the color scale of a 2D plot can only be set relatively to the values of the plot itself, something like:

PV = Plot’s value

Red —> Max PV

Green —> 0.5 * (Max PV - Min PV)

Blue —> Min PV

Is there a way to set an absolute scale that doesn’t depend on the plot’s values ? i.e. something like:

AV = An arbitrary value

Red ----> 1 * AV

Green —> 0.5 * AV

Blue —> 0 * AV

To be more specific I’m dealing with a 2D graph that contains efficiency values (which I don’t produce using the TEfficiency class), so in my case AV = 1.

Thanks !

The only trick I know is to add two artificial points to the graph, one with your desired “minimal value” and another one with your desired “maximal value” (for a 2D histogram, I overwrite two bins, usually (1, 1) and (nbinsx, nbinsy)).

Hi,
you may set the contourlevels + colors by yourself
See the att macro stolen and mod from roots tutorials.

Cheers
Otto
contour_graph2d.C (1.55 KB)