Re: TCanvas::BuildLegend & TF1

From: Lorenzo Moneta <Lorenzo.Moneta_at_cern.ch>
Date: Wed, 4 Aug 2010 15:01:37 +0200


Hi,

 In this case, as Axel pointed out the interpreted function has more information and knows the name of the function. We can have the same behavior only by removing the setting of the function title in case of interpreted function. This is not nice in my opinion and will change the behavior of the existing users. I think is then better to maintain this difference, which is not the only one (for example see TF1::EvalPar and TF1::InitArgs) The user must be aware when using an interpreted function (in CINT or Python) or a compiled one. The performances can be also very different.
We will, however, document this differences in the TF1 reference doc

 Cheers , Lorenzo
On Aug 4, 2010, at 11:04 AM, Axel Naumann wrote:

> Hi,
> 
> this is simply the way TF1 sets the title when being passed an
> interpreted function (TF1.cxx:603-604):
>  const char *funcname = gCint->Getp2f2funcname(fcn);
>  SetTitle(funcname);
> I.e. the different behavior is expected. You can explicitly set the
> title after the creation of the TF1 to circumvent the automatic naming.
> 
> Cheers, Axel.
> 
> Olivier Couet wrote on 08/04/2010 10:58 AM:

>> Hi Vassili,
>>
>> I found out that this problem is not graphics related but has to do with
>> CINT.
>> I sent the result of the investigation I did to Axel who will look at
>> it.
>> Thanks for reporting.
>>
>> Cheers,
>> Olivier
>>
>> -----Original Message-----
>> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
>> On Behalf Of Olivier Couet
>> Sent: Wednesday, August 04, 2010 9:57 AM
>> To: Vassili Maroussov; roottalk_at_root.cern.ch
>> Subject: RE: [ROOT] TCanvas::BuildLegend & TF1
>>
>> Yes, you should do:
>> ..Draw();
>> ..Draw("same);
>> But still the texts in the legend are different.
>> In one case the names appear and in the other the titles.
>> Weird ....
>> I am investigating.
>>
>> -----Original Message-----
>> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
>> On Behalf Of Vassili Maroussov
>> Sent: Tuesday, August 03, 2010 6:22 PM
>> To: roottalk_at_root.cern.ch
>> Subject: Re: [ROOT] TCanvas::BuildLegend & TF1
>>
>> Sorry,
>>
>> I've used TGraph drawing options with TF1 (standard confusion...), but
>> still: why the result is different for the interpreter and ACLiC?
>>
>> Regards,
>>
>> Vassili
>>
>> On 08/03/2010 05:58 PM, Vassili Maroussov wrote:
>>> Dear ROOTers,
>>> 
>>> after running the CheckBuildLegend.C script attached I expect to see 
>>> plots of sine (kBlue) and cosine (kRed) in the same TCanvas with 
>>> legend which contain "Sine" and "Cosine". However, neither in the 
>>> interpreter (.x CheckBuildLegend.C) nor in the ACLiC (.x
>>> CheckBuildLegend.C+) mode a see both plots, but only the last 
>>> "TF1::Draw". Moreover, resulting plot looks differently in the 
>>> interpreter and ACLiC modes. What's wrong?
>>> 
>>> Regards,
>>> 
>>> Vassili
>>> 
>>> P.S. Linux 2.6.32.16-141.fc12.x86_64, gcc version 4.4.4 20100630 (Red 
>>> Hat 4.4.4-10), ROOT 5.27/05 (trunk_at_34633, Jul 28 2010, 13:31:45 on
>>> linuxx8664gcc)
>>> 

>>
>>

> Received on Wed Aug 04 2010 - 15:01:43 CEST

This archive was generated by hypermail 2.2.0 : Wed Aug 04 2010 - 17:50:01 CEST