RE : RE : [ROOT] Gradient Palette when drawing 2D histograms with "col" option

From: ANCIANT E. (
Date: Fri Mar 26 2004 - 14:33:47 MET

Hi Olivier,

> Yes, the choice to not draw the empty bins was made to show clearly
> they are empty. Having done that choice "the colour of nothing" is
> the background color of the frame which can be set to the first color
> the palette if needed.

... I am not certain this choice makes things clear.
I bet most users are unaware of the existence of a TFrame,
and that at least some of them, using the "col" option, interpret the
"frame-coloured" bins as bins "coloured" with the "0 (or minimum) colour
of the palette".

See for example my attached macro binx =2, biny =4, 5 are confusing ...
I know it is a little bit weird example, but I still feel that if the
bottom part was coloured with the same light-grey as binx = 1, biny = 5
( the same way the top part is coloured with the same colour as binx =
6, biny = 10) the interpretation would be more clear.

Moreover, finding all the TFrame of all drawn histogram to set their
colour to the minimum colour of the palette kills the general scope of
"gStyle->SetPalette". Concretely, how can I force my second-hand users
to change the frame colour everytime they draw a newly created histogram

> [...]
> > ( and from my points of view, drawing with last available colour in
> > the palette ...)
> that is what is done now.

For maximum value yes, not minimum ( = not drawn) ... my question was
why a difference in behaviour between minimum and maximum, especially
when those limits are set by users through SetMinimum and SetMaximum
?... (I could ask the same question for "text" option).

> Yes, I think a new option would be the best solution because, seems to
> me, each user has his own view of what the COL option should do and
> these different views are incompatible. The two last modifications I
> make sense: one was clearly a bug (wrong color in some upper bins) and

thanks a lot for fixing it ...

> other one was logical because if the histogram has a negative minimum
, a
> bin with 0 content cannot be considered as empty. I don't think we can
> really go further with this option COL.
>  Now you suggest that the current COL becomes COL0, right ? We cannot
> that, I guess, this will have to many side effects for users familiar
> the current COL option behavior. If we decide to implement a new
> it should be covered by a new option.

You are right, it is not wise to modify the behaviour of the existing
(though I bet in that case, this could have helped a few users to
discover that they have been misinterpreting some of their results ;-)
... )

So the new option (we could call it "colf","colfz" for 'f' = Full
coloured, I m not very good at choosing meaningfull names) would be:

> - I guess 0 should not be a special case

Yes, even more : simple rule : all bins are drawn ...

> - what do we do if a minimum/maximum value is set by
> ?

Values below minimum are drawn with the colour of minimum.
Values above maximum are drawn with the colour of maximum.
(after all what is done for "lego" and "surface" options .. )

Cheers, Eric

And many thanks for your attention and time ...


	TCanvas* can = new TCanvas("black_canvas");

	/* Histogram with a ramp from 0 */
	int i,j;
	TH2F h("h","h",10,0,10,10,0,10);

	col  = 0;
	for (j =0;j<30;j++) {
		for (i=0;i<30;i++) {
			if (i<10) col += 1;




Ce message et eventuellement les pieces jointes sont exclusivement transmis a l'usage de leur destinataire. Leur contenu est strictement confidentiel. Si vous n etes pas le bon destinataire nous vous demandons de ne pas conserver, copier, utiliser ou divulguer cette communication. Merci de le detruire et de me notifier cette erreur.

INTERNET ne permettant pas d assurer l integrite de ce message, SODERN decline toute responsabilite au cas ou il aurait ete intercepte ou modifie.

This message and possibly attachments are transmit for the exclusive use of their address. Their content is strictly confidential. If you are not the intended recipient please do not keep, copy, use or disclose this communication to others. Also please delete it and notify the sender at once.

Because of the nature of INTERNET the sender is not in a position to ensure the integrity of this message, therefore SODERN disclaims any liability whatoever in the event of this message having been intercepted and/or altered.

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET