Set individual alphanumeric bin label color

Dear ROOTers,

I would like to know if it is possible to set the label color for an alphanumeric axis individually per bin. The only function I find to set bin label color is TGAxis::SetLabelColor(Int_t labelcolor).

Thanks in advance,


The trick will be to include the #color TLatex operator in your labels.

See how to use it here:

Dear Olivier

Very nice, works like a charm now. Thanks!


Dear Andrée,

That’s good ! you can even set the color programatically if you need, using Form()

Form("#color[%d]{Label}", icol);


You might also find the following old topic useful: [url]Proper alignment of text bin labels