Re: [ROOT] What's that? pow(x, -2.2) in Log-Log-Plot...

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Apr 24 2002 - 15:51:16 MEST


Hi Thomas,

Replace your function test by the following one:
void test()
{
    TCanvas *c1 = new TCanvas("c1");
    gPad->SetLogx();
    gPad->SetLogy();
    TF1 func1("LF", lumifunc, 0.001, 1, 0);
    func1.DrawCopy();
}

The problem is that a TF1 created with an interpreted or compiled function
cannot be truely cloned. When cloning this type of functions, Root
saves an array of points computed at equidistant values.

Rene Brun

On Wed, 24 Apr 2002, Thomas Bretz wrote:

> Hi all,
> 
> I'm trying to make a very simple log-log-plot of a very very simple
> function... BUT...it doesn't appear as a line... (I'm using root 3.02/07
> on Linux kernel 2.4.6) I attach a plot how it looks like... It is
> neither working as macro nor with Aclic. I tried also an interpreted
> function
> TF f("pow(x, -2.2)", ...)
> this seems to work fine.
> 
> --------- macro: test.C ----------
> 
> Double_t lumifunc(Double_t *x, Double_t *k=NULL)
> {
>     Double_t N0=1.0;
>     return pow(x[0], -2.2);
> }
> void test()
> {
>     TF1 func1("LF", lumifunc, 0.001, 1, 0);
>     func1.Clone()->Draw();
>     gPad->SetLogx();
>     gPad->SetLogy();
> }
> 
> -----------------------------------
> 
> Can I do something wrong here?
> 
> Best regards,
> Thomas.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:51 MET