Re: SetTitleSize() and SetLabelSize()

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Fri, 20 May 2005 09:00:05 +0200 (MEST)


OK I understand the issue now.
You are filling a histogram with automatic binning and you have only one entry. When the histogram buffer is is emptied, the axis attributes are reset. I have fixed this problem in the development version in CVS. With your version you can circumvent the problem by calling

   hist->BufferEmpty(1);
before setting the axis attributes.

Rene Brun

On
Fri,
20 May 2005, OKUMURA, Akira wrote:

> Dear Rene,
>
>> Could you explain what is the problem ?
> The problem is that title size and label size can not be changed.
>
>> TH1D* hist = new TH1D("", "", 40, 0, 0);
> => NG
>> TH1D* hist = new TH1D("", "", 40, 0, 1);
> => GOOD # upper-edge is 1
>
>> Please indicate which version of ROOT
> Version 4.04/02 4 May 2005 on Mac OS X 10.3.9 w/ gcc 3.3
> and
> Version 4.02/00 16 December 2004 on RH 7.3 w/ gcc 2.96
>
> I apologize to my short explanation.
>
> Sincerely,
>
> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> Tel/Fax : +81 4-7136-3153
> Skype : okumura.akira
>
> On 2005/05/20, at 4:30, Rene Brun wrote:
>
>> Could you explain what is the problem ?
>>
>> Please indicate which version of ROOT
>>
>> Rene Brun
>>
>> On Fri, 20 May 2005, OKUMURA, Akira wrote:
>>
>>> Dear ROOTers,
>>>
>>> Please try the attached test program.
>>> SetTitleSize() and SetLabelSize() do not work.
>>> But , for example, SetTitle() and CenterTitle() work properly.
>>> This problem happens only when I use same values for low-edge and
>>> high-edge.
>>>
>>> Is there any way to solve this problem?
>>> I would like to use same values for the edges because I am not sure the
>>> range of experiment data values.
>>>
>>> void test()
>>> {
>>> TCanvas* can = new TCanvas;
>>> TH1D* hist = new TH1D("", "", 40, 0, 0);
>>>
>>> hist->Fill(1, 1);
>>> hist->GetXaxis()->SetTitle("X");
>>> hist->GetYaxis()->SetTitle("Y");
>>> hist->GetXaxis()->CenterTitle();
>>> hist->GetYaxis()->CenterTitle();
>>> hist->GetXaxis()->SetTitleSize(0.05);
>>> hist->GetYaxis()->SetTitleSize(0.05);
>>> hist->GetXaxis()->SetLabelSize(0.05);
>>> hist->GetYaxis()->SetLabelSize(0.05);
>>> hist->Draw();
>>> }
>>>
>>> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
>>> Institute for Cosmic Ray Research, University of Tokyo
>>> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
>>> Tel/Fax : +81 4-7136-3153
>>> Skype : okumura.akira
>>>
>>>
>>
>>
>
Received on Fri May 20 2005 - 09:00:38 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:08 MET