Zooming a TTree

I use root 4.00/3 and 3.10/2 win32gdk on win2k. If I draw a tree, e.g. pTree->Draw(“y:x”…) and use the mouse to zoom in along one of the axes, I reach a limit, beyond which no further re-drawing (i.e. zooming) occurs. Are there any parameters that control this limit?

What I’d like to do is the following: if the user tries to zoom beyond the limit, my code would simply append appropriate x- or y- limits to the cut to give that axis more resolution. The problem is, I would need a “zoom beyond resolution” signal or something.

Any suggestions? Thanks…


Hi Ed,

I do not think it is something “TTree specific”. I just looked in TAxis::ExecuteEvent and it seems the zoom resolution is fixed and cannot be changed. In this method the zomming code is triggered by a test like: if (ratio2 - ratio1 > 0.05) { …}


Hi Olivier,
I believe the behavior goverened by " if (ratio2-ratio1>0.05)…" simply limits how large of a zoom can be accomplished in a single step - this is not what I’m asking about. In the case of a 1D histogram, the x-axis or y-axis can be zoomed to an arbirary amount if enough steps are taken. For a 2D histogram, there is a limit to how much you can zoom, regardless of what size steps are taken. I’m asking for a way to give the 2D histograms (like those produced w TTree::Draw(“y:x”) the same flexibility. Thanks.



You must change the number of bins in X or/and Y. By default, you cannot zoom below one bin.
The default number of bins for 2-d plots is 40x40. When calling TTree::Draw you can specify a different number. see TTree::Draw documentation.