Re: RangeAxis

Rene Brun (Rene.Brun@cern.ch)
Fri, 21 Feb 1997 08:50:32 +0100


Thomas Kraemerkaemper wrote:
> I can't get a plot on top of a predefined coordinate system. What I
> have tried so far looks like:
>
> {
> gROOT->Reset();
>
> TFile f("output.root");
> f.ls();
>
> TCanvas *canvas = new TCanvas("canvas", "My Canvas", 0, 0, 640,80);
> canvas->RangeAxis(0., 0., 60., 60.);
> // canvas->Range yields to the same (wrong) result.
> ntuple.Draw("x:y", "", "BOX");
> }
>
> The ntuple.Draw() ignores the 'RangeAxis' and plots in my example in
> the range (0., 0., 60., 55.).
>
> With 'ntuple.Draw("x:y", "", "BOXSAME");' nothing is shown at all.
>
> Did I misunderstand the aim of RangeAxis? How can I directly access
> the TAxis-objects after ntuple.Draw()?
>
> Bye, Thomas Kr"amerk"amper.

When the option same is used in a TTree::Draw call, we create
a temporary histogram object with the same parameters as the previous
histogram object. We assume that there is always one. In your example,
this is not the case. I will also take into account this particular
case in the next version.
Meanwhile, you can do the following:
TH2F hframe("hframe","",40,0,60,40,0,60);
hframe.Draw();
ntuple.Draw("x:y","","boxsame");

Rene Brun