Re: How to set range of y-axis for THStack?

From: Alexander Mann <amann_at_uni-goettingen.de>
Date: Mon, 19 Sep 2011 10:07:12 +0200

Hi,

thanks for your suggestions, but it does not work yet.

Actually I am already drawing it twice (cf. the macro I included in my first mail):

   s->Draw();
   s->GetHistogram()->SetMinimum(3);
   s->Draw();

Still, the minimum is not 3.

cu
Alexander

On 09/19/2011 02:35 AM, Fine, Valeri wrote:
> Dear Alexander,
>
> Please try to apply the "rule of thumb". It is as follows.
>
> To customize THStack object look one MUST 'Draw()' it TWICE (at least).
>
> 1. First you should invoke 'Draw' it "as is"
> 2. then you can customize the plot visual attributes
> 3. now you should re-draw the object again. (or just update the TPad) to get what you want.
>
> Re-check now the Duc's example from '3 steps' rule stand point.
> Do not ask me why it (THstack) was done this way. I do now know.
>
> Hope this helps.
>
> Best regards , Valeri Fine
> -----------------------------------
> Brookhaven National Laboratory
> Upton, NY 11973
> Phone +1-631-344-7806
>
>> -----Original Message-----
>> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Duc
>> Bao Ta
>> Sent: Friday, September 16, 2011 7:16 PM
>> To: Alexander Mann
>> Cc: roottalk_at_root.cern.ch
>> Subject: Re: [ROOT] How to set range of y-axis for THStack?
>>
>> Hi Alexander,
>>
>> have a look at the reference for THStack
>> (http://root.cern.ch/root/html/THStack.html#THStack:GetXaxis), this
>> should work:
>>>>> stack.Draw()
>>>>> stack.GetXaxis().SetRangeUser(-1,1)
>>>>> stack.Draw()
>>
>> Cheers
>> Duc
>>
>> On 16 September 2011 18:35, Alexander Mann<amann_at_uni-goettingen.de> wrote:
>>>
>>> Hi,
>>>
>>> I haven't succeeded at the simple task of setting the y-axis range for a
>>> THStack using all possible ways I could think of.
>>>
>>> The example script I have attached demonstrates all the things I've tried.
>>> Most of them indeed do influence the y-axis range, but none yields targeted
>>> value of 3.
>>>
>>> Using ROOT 5.30/00. The y-axis is logarithmic.
>>>
>>> I'd be grateful for any hints.
>>>
>>> cu
>>> Alexander
>>>
>
Received on Mon Sep 19 2011 - 10:07:20 CEST

This archive was generated by hypermail 2.2.0 : Mon Sep 19 2011 - 11:50:01 CEST