Hi Tohru,
You can set the width and heigth of the title box with, eg:
gStyle.SetTitleW(0.7); //per cent of the pad width
gStyle.SetTitleH(0.08); //per cent of the pad height
The font size will be automatically adapted in function of the box size
and the number of characters.
Rene Brun
Tohru Ohnuki wrote:
>
> Hello again, have a question about setting the size of graph titles on
> graphs that are generated by a macro. By title i mean the box in upper
> left that is set by TCanvas::SetTitle(), not the titles of the axes. I
> have tried the following:
>
> gStyle->SetTitleFontSize(0.1); this doesn't seem to ever work, even after
> gROOT->ForceStyle
>
> TPaveText *title = (TPaveText*)plotcanvaskey->GetPrimitive("title");
> title->SetTextSize(0.08);
> plotcanvaskey->Modified();
>
> The previous works for c1 autogenerated canvases but not ones i make :(
>
> Just plotcanvaskey->GetPrimitive("title") returns a null pointer. Doing a
> plotcanvaskey->GetTitle(), returns a string of the title text, but not the
> pointer to the title object, unlike plot->GetXaxis().
>
> Am i missing something, or confusing graph title with axis title? I am
> using root-3.05.02 on RH-7.2 linux with gcc-2.96 compiler.
>
> Regards,
>
> Tohru O.
> --
> UCLA Physics & Astronomy Dept.
> GSR-IV Data Monkey
> ohnuki@physics.ucla.edu
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET