Re: TCanvas::BuildLegend & TF1

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Wed, 4 Aug 2010 11:04:29 +0200


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 - 11:04:34 CEST

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