Re: setting y-range

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Mon, 7 Nov 2005 15:52:27 +0100 (CET)

Hi,

 I am not an expert of the Tree viewer, but seems to me the best way to do quickly and easily what you want is to make a macro file. You can then execute it with ".x macro.C". In that file you will be able to change all the limits you want. This has also the advantage that you will not be oblige to redo all the mouse manipulations each time you will redo this plot. May be somebody knowing better than me the tree viewer can tell you more about it.

Cheers, Olivier

On Mon, 7 Nov 2005, Hajo Molegraaf wrote:

> 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/
>
>

-- 
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail: Olivier.Couet_at_cern.ch                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7670300
Received on Mon Nov 07 2005 - 15:52:33 MET

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