2D histograms and logarithmic axes

From: Marco van Leeuwen (mvl@nikhef.nl)
Date: Fri Dec 10 1999 - 13:30:14 MET


Hi,

I have a few remarks regarding 2D histograms. As far as I understand, it is
still impossible to draw a lego, surface, or contour histograms with a
logarithmic x or y axis. (By the way, it might make sense to print an error
message or execute a gPad->SetLogx(0) and gPad->SetLogy(0) instead of
splashing green an yellow dots all over the canvas.) Furthermore, if you
use a TH2F with a logarithmic x axis, you would normally prefer to have
equidistant binning in log x instead of x. For example, if your histo
ranges from 0.01 to 100, you have to use a 0.01 binwidth in order to have
some decent results in the low x-range, whereas for the high range 1 of
even 10 would suffice. 
  Having these two in mind, I propose to have a drawing option or TAxis
switch to draw a logarithmic axis where the axis values are exponentiated,
i.e. an axis ranging from -1 to 3 will be drawn as a logarithmic scale
ranging from 0.1 to 1000. If I am not mistaken, this should be fairly
simple to implement (I even tried to implement this myself, but
unfortunately the "AH" option is only supported for 1D histograms), and
have the by-product of solving (at least to first order), the problems with
the surf and cont options for a 2D histogram. The idea is that you can use
a histogram ranging from  -1 to 3, fill it with the log10() of your data
and plot it, displaying axis which make sense for the data.

A second point, which I would like to bring up, is that some people are
used to also having square-root axes. These have roughly the same effect as
the logarithmic axes, but behave more smoothly near zero. I wouldn't
propose to have this supported to the same extent as logarithmic axes, but
I found that in the specific case of the third axis in 2D-histograms, (i.e.
the z-axis/the cell-content) this can be far superior to a logrithmic
scale, expecially when drawing a 'scatterplot'. If other people have the
same experience, it might be worthwhile to implement this as a standard
feature of root.

Regards,

Marco van Leeuwen.

(P.S.: I am using root 2.23/09 on some Linux platform)



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:44 MET