setting y-range

From: Hajo Molegraaf <hjausenet_at_hotmail.com>
Date: Mon, 07 Nov 2005 15:25:30 +0100


Hi,

I'm new to ROOT and there are a few things that I can not get to work. I like the TreeViewer that can be lanched from the TBrowser, but I have a problem setting the y-range. With the following script I create a root file

//************************

{

    TFile* file = new TFile("test.root","RECREATE");     TNtuple* data = new TNtuple("data","","Temperature:Resistance");     double T, R;
    for( T = 10.0; T < 300.0; T += 1.0 )     {

        R = T*T;
        data->Fill(T,R);

    }

    file->Write();
    file->Close();
}

//*************************

I can open this root file in the TBrowser and I can view the TNtuple with the TreeViewer. I drag the Temperature branch to X and the Resistance branch to Y and I click on the button to draw the graph. This creates a nice graph, but I want to change the appearance of the y-scale.

  1. Is there a way to now quickly rescale the y-axis (or the data) by 1000, still showing all the data, and to put as a y-axis title "Resistance in k#Omega"

I want to have a logaritmic y-scale. So I click on the canvas and choose SetLogy. This changes the y-scale from around 2.5e3 to 1e5. Well, I want to see all the data, so I click on the y-axis and select SetRangeUser. I fill in 10 for ufirst and 1e7 for ulast. This changes the y-range from 3e5 to 1e7.

2) How can I change the y-range? (preferably without having to type things on the ROOT command line)

I'm using ROOT Version 5.05/01 21 September 2005, Compiled on 26 October 2005 for linux after downloading the CVS version.

Thanks,
Hajo Molegraaf



Vind alles terug op je PC: MSN Search Toolbar http://toolbar.msn.nl/ Received on Mon Nov 07 2005 - 15:25:37 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET