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

From: Fine, Valeri <fine_at_bnl.gov>
Date: Sun, 18 Sep 2011 20:35:50 -0400


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 - 02:36:15 CEST

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