Re: Histogram title

From: zampolli <Chiara.Zampolli_at_bo.infn.it>
Date: Sat, 18 Nov 2006 12:04:53 +0100


Hi Rene,
thanks a lot, yes, I forgto the option... By the way, it still does not work... I have tried with many combinations of the various commands (the canvas is defined as: "TCanvas *ciccio = new TCanvas("ciccio","ciccio",-2,30,800,500);"):

  1. Following also a suggestion i found in the roottalk forum: gStyle->SetTitleFont(63,""); gStyle->SetTitleFontSize(20);

but in this case the box is too big, and I don't see the text at tall.

2)
  gStyle->SetTitleFont(63,"");
  gStyle->SetTitleFontSize(0.5);

in this case, the title box is still huge, and the text very tiny... And the SetTitleFontSize seems to afect only the dimension of the box, not of the text...

3) adding:
  gStyle->SetTitleSize(0.09,"");
nothing changes, neither for case 1) nor for case 2)

4) trying with title font 62 (so that the size should depend on the dimension of the canvas, right?), nothing never happens, the text size remains always the same, and the box size changes accoridng to what I set with SetTitleSize().

What am I doing wrong? Probably I somehow use in the wrong way the numbers to set the font and the sizes....

Thanks a lot.
Cheers,
ch

Rene Brun ha scritto:

> Hi Chiara,
>
> Please read the documentation of TStyle::SetTitleFont
> http://root.cern.ch/root/htmldoc/TStyle.html#TStyle:SetTitleFont
>
> =====
> void SetTitleFont(Style_t font, Option_t *axis)
> if axis =="x" set the X axis title font
> if axis =="y" set the Y axis title font
> if axis =="z" set the Z axis title font
> any other value of axis will set the pad title font
> if axis="xyz" set all 3 axes
> ====
>
> Also note that if you select a font style in pixels (63), you should
> specify a number
> of pixels for the font size. See class description of TAttText at
> http://root.cern.ch/root/htmldoc/TAttText.html
>
> Rene Brun
>
>
> zampolli wrote:
>> Hi rooters,
>>
>> how can I modify the size of the title of a histogram? I have
>> tried with:
>>
>> gStyle->SetTitleFont(63);
>> gStyle->SetTitleFontSize(0.09);
>>
>> but the only thing which changes is the size of the pavetext where
>> the title is written, not the dimension of the font. Moreover, these
>> lines affect also the x-axis title, that I don't want to happen...
>> Could you please help me?
>>
>> Thank you a lot.
>> Best Regards,
>>
>> Chiara
>
Received on Sat Nov 18 2006 - 12:08:22 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:02 MET