Re: [ROOT] 'bar' and 'SetRangeUse' plot option for TGraph::Draw(Option_t *option)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jun 10 2003 - 18:00:41 MEST


Hi Ralph,

On Tue, 10 Jun 2003, Ralph Steinhagen wrote:

> Hello!
> 
> I used the TGraph routine
> [..]->Draw("ABP");
> to draw a graph with bars instead of connecting the points with lines. 
> 
> 1.) Is there a possibility to vary the bar width of the points?

Yes, use TStyle::SetBarOffset/setBarWidth.
see an example in the macro in attachement.

> 2.) TAxis::SetRangeUser(..) 
can just be varied between the first and the last 
> entry. What do I have to do to set the axis window even larger than the 
> spread of the points on the axis?

If you use the option "A", the range is automatically computed from the 
values in the graph. If you want to set your own range, you can use, eg
c1.DrawFrame(xmin,ymin,xmax,ymax) and omit the option "A"

Rene Brun

> 
> Thanks in advance!
> 
> Cheers,
> 
> Ralph Steinhagen
> 
> 
> 
> void TAxis::SetRangeUser(Axis_t ufirst, Axis_t ulast)
> {
> //  Set the viewing range for the axis from ufirst to ulast (in user 
> coordinates)
> //  To set a range using the axis bin numbers, use TAxis::SetRange.
> 
>    SetRange(FindBin(ufirst),FindBin(ulast));
> }
> 
> 





This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET