Re: How to change properties of PaveText of a title

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Thu, 13 Sep 2007 20:59:37 +0200


Use gStyle->GetTitleFillColor();

When you have questions of this type, you can always look at the source code. To see how the attributes
for the title TPaveText see THistPainter::PaintTitle function (near the end) at
http://root.cern.ch/root/html/src/THistPainter.cxx.html#VCNqX

Rene Brun

Carlos Osuna wrote:
> Hello all,
>
> I want to change the properties of a PaveText of the title of a
> histogram in the canvas such as it fill color. I navigate through the
> roottalk I found some previous mails which helped me a bit. So I found
> a solution but the problem is that this is working when a execute it
> with root interactively but not within a macro. The line below
> pad->GetListOfPrimitives().Print() produces a different output in both
> context, and this list does not contain the title when using a macro.
>
> Has anybody any idea of how to change the tite properties within a
> macro? Im using root version 5.14
>
> thanks, carlos
>
> {
> TCanvas c2;
> TH1F *h1 = new TH1F("h1","h1",100,0,1);
> h1->Fill(0.2);
> h1->Draw();
> TPad *pad = c2.cd(0);
> pad->GetListOfPrimitives().Print();
> TPaveText *t1 = (TPaveText*) pad->GetPrimitive("title");
> if(t1)
> t1->SetFillColor(6);
> }
>
Received on Thu Sep 13 2007 - 20:59:43 CEST

This archive was generated by hypermail 2.2.0 : Sat Sep 15 2007 - 17:50:01 CEST