RE: setrange of x-axis

From: Amnon Harel <amnon.harel_at_cern.ch>
Date: Thu, 21 Jul 2011 12:06:38 +0000


Dear Tim and Olivier,

I happen to be writing a macro that uses these methods right now. I have a TGraphErrors that I wish to display with costumized axis ranges. I needed SetRangeUser for the y-axis, and SetLimits for the x-axis.

(Perhaps some peculiarity of my graph and/or ranges is relevant)

It'll be great to have the documentation explain enough for this kind of behavior to make sense, or at least guide the user to look at the other way of setting the range.

 cheers,
 Amnon



From: owner-roottalk_at_root.cern.ch [owner-roottalk_at_root.cern.ch] on behalf of Tim Head [betatim_at_gmail.com] Sent: 21 July 2011 13:54
To: Olivier Couet
Cc: p.rodrigues1_at_physics.ox.ac.uk; roottalk_at_root.cern.ch Subject: Re: [ROOT] setrange of x-axis

On Thu, Jul 21, 2011 at 8:20 AM, Olivier Couet <Olivier.Couet_at_cern.ch> wrote:
> The doc says that SetLimits defines the limit of the axis (min and max),
> whereas SetRange and SetRangeUser define the viewing range within these
> limits. I do not see what you could says more ?
> Any suggestions ?

At the very least the SetLimits() docs should explicitly state that this function does _not_ do what 90% of users expect it to do (which is to determine the range of the axis shown when drawn) [1]. Especially as it appears in the docs before the more obscurely named functions SetRange() and SetRangeUser().

Tim

[1] What does it even mean to limit the range of an axis if not for plotting purposes? Particularly for a TGraph which you pass all the points it will ever know about when you first create it.

>
> On 7/20/11 2:43 PM, "Philip Rodrigues" <p.rodrigues1_at_physics.ox.ac.uk>
> wrote:
>
>>It would be useful if the documentation of TAxis::SetLimits could be made
>>a
>>bit clearer - at the moment it's not obvious how it differs from
>>SetRangeUser.
>>
>>Cheers,
>>Phil
>>
>>On Wednesday, July 20, 2011 07:01:15 AM Olivier Couet wrote:
>>> See: http://root.cern.ch/drupal/content/how-set-ranges-axis
>>>
>>> From: Summit Kumar
>>> <rhythm4summit_at_gmail.com<mailto:rhythm4summit_at_gmail.com>> Date: Wed,
>>20
>>> Jul 2011 16:29:38 +0530
>>> To: <roottalk_at_root.cern.ch<mailto:roottalk_at_root.cern.ch>>
>>> Subject: [ROOT] setrange of x-axis
>>>
>>> Hello Rooters,
>>>
>>>
>>> I have caught in very simple problem. I have plotted a graph by using
>>> TGraph. I want to know how can I enlarge x-axis.within certain limits?
>>>
>>>
>>> --
>>> THANKS
>>> With regards,
>>>
>>> Summit.
>>
>
>

--
http://tim.jottit.com/
Received on Thu Jul 21 2011 - 14:06:45 CEST

This archive was generated by hypermail 2.2.0 : Thu Jul 21 2011 - 17:50:02 CEST