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

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Fri Mar 26 2004 - 15:35:45 MET


Hi Eric,

[...]
> 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
> ?

Well, that example is a bit misleading because the background color is 
equal to one of the color in the middle of the palette (the 2nd from 
bottom in fact). One can easily see that the choice of background color is 
not really accurate. 

 I do not think that the current behavior is so weird because at some time 
ago (one year or so) I had change it to what you are requesting (IE: 
drawing the empty bins) thinking there was no reasons to treat such bins 
in a different way. We had immediately MANY complaints and after a common 
agreement with several unhappy users it was decided that empty bins should 
not be drawn. At that time leaving them painted with the background color 
appeared to be the best solution.


> 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).


Well, again it was agreed that way ... changing the behavior will be 
really catastrophic. We went through that once I do not really want to 
make it again ... (see below for further details).


> 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
> SetMinimum/SetMaximum
> > ?
> 
> 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 .. )

Yes I agree it is that way for lego and surface, but that are 3D plots and 
they clearly show the Z axis so we get immediately the idea that the 
histogram is cut whereas when drawn with COL, TEXT or BOX options the 
histogram is seen from top and if we apply your rule:

"Values below minimum are drawn with the colour of minimum" 

some bins (in particular the empty ones) will appear populated whereas 
they are not ! (actually that is the reason of the test on zmin)

May be before implementing it as a new option it would be useful to just 
have it as a simple macro (at the end it is just a matter of looping over 
the histogram bins and draw colored boxes), play a bit with it to fully 
understand what is needed.

 Cheers,       Olivier


-- 
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail: Olivier.Couet@cern.ch                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7677155



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