Re: Zooming problem with TGraph

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 3 May 2006 09:12:36 +0200 (MEST)


Hi Marco,

On Wed, 3 May 2006, Marco Calviani wrote:

> Hi Rene,
> thanks for the bits, now the visualization, zooming and unzooming
> is working. However now i've problem in other fields:
> 1) i'm not able to use correctly the FitPanel since it performs the
> fit in a location different to that selected with the bar in the
> panel;

I do not understand this. Are you fitting a TGraph? a TH1? Are you sure to fit the right object? Before using the fit slider, you must make sure that the FitPanel is set for the right object.

> 2) I'm not able to save the TGraph in a root file, since when i reopen
> the saved root file and plot the graph, nothing appears. This is the
> code i've added to the past macro:
>
> TFile *dati = new TFile("dati.root","RECREATE");
> gr->Write("Cm245");
>
> dati->Write();
> dati->Close();
>

To read the graph, two possibilities

   1-via the command line

     TFile *f = new TFile("dati.root");
     TGraph *gr = (TGraph*)f->Get("Cm245");
     gr->Draw("alp");

   2-via TBrowser
    TBrowser b;
    open the root file dati.root
    Set the "draw" option at the top of the browser to "alp"     double-click on Cm245

Rene Brun

> Many thanks,
> Marco
>
> 2006/4/29, Rene Brun <Rene.Brun_at_cern.ch>:
>> In attachement, see a new version of your script that will work
>> correctly with unzooming. It uses a function DrawFrame that is
>> a copy of the updated function TPad::DrawFrame now in CVS.
>>
>>
>> Rene Brun
>>
>
Received on Wed May 03 2006 - 09:12:40 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET