you must c1.Update() after myhist->Draw() if you execute within a macro,
otherwise the title object is not yet generated.
Rene
On 07/02/2011 15:39, Jiri Kvita wrote:
> Hello Rene!
>
> Thanks for an interesting post!
> However, I keep getting a null pointer to the title...
> See attach with your lines + little modifications:
> root -l hist_title.C
> I tried under 5.28.
>
> With thanks and regards,
>
> Jiri
>
> Rene Brun wrote:
>> example:
>>
>> TCanvas c1;
>> myhist->Draw();
>> TPaveText *title = (TPaveText*)c1.GetPrimitive("title");
>> title->SetFillColor(kCyan);
>> c1.Modified();
>>
>> Rene Brun
>>
>>
>> On 04/02/2011 18:39, Mario Kadastik wrote:
>>> Hello,
>>>
>>> I've found how to enable and disable the histogram title printing,
>>> but how do I access the element itself per histogram? I would like
>>> to change the fill color, the shadow if possible as well as the
>>> concrete location where it's drawn. I've got a generic style setting
>>> file (the one CMS supplies for publications) and I've tuned it to
>>> generally show good plots already (i.e. fill color kWhite
>>> everywhere), but the histogram title that I'd like to use on some
>>> plots still comes out with grayish filling and I have to manually
>>> intervene to make it white.
>>>
>>> Thanks in advance,
>>>
>>> Mario Kadastik, PhD
>>> Researcher
>>>
>>> ---
>>> "Physics is like sex, sure it may have practical reasons, but
>>> that's not why we do it"
>>> -- Richard P. Feynman
>>>
>>
>
Received on Mon Feb 07 2011 - 15:43:00 CET
This archive was generated by hypermail 2.2.0 : Thu Mar 17 2011 - 23:50:02 CET