Re: number axis values plotted

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Mon, 29 May 2006 17:36:23 +0200 (CEST)

Hi,

As indicated in the documentation, you should use the option "N":

// Axis binning optimization.
// -------------------------
//
//   By default the axis binning is optimized .
//
//       chopt='N': No binning optimization
//       chopt='I': Integer labeling
//

Cheers, Olivier

On Mon, 29 May 2006 flucke_at_mail.desy.de wrote:

> On Fri, 26 May 2006, Rene Brun wrote:
>
> > h[0] = new TH1F("h1", "h1", 10, 0, 10);
> > h[0]->GetXaxis()->SetNdivisions(505);
> >
> > I strongly suggest to use the graphics editor to check quickly
> > the best settings.
>
> Hi Rene,
> thanks, now I finally understand how this Ndivisions is decomposed! I was
> too stupid to understand (or too lazy while reading) the documentation...
>
> But now I stumble over the fact that it is not done in the same way for
> TGaxis as it is done for TAxis: For TGaxis I cannot switch off the
> optimisation: There is no bool as second argument for
> TGaxis::SetNDivisions(..) and negative values seem to stop root.
>
> See the attached macro where I try to plot a TGaxis for an axis from 0 to
> 180 with 6 main divisions (guess which quantity it is...)
>
> I tested on ROOT 4.04.02 and 5.10.00.
>
> Cheers
>
> Gero
>
> > On Fri, 26 May 2006, flucke_at_mail.desy.de wrote:
> >
> > > Dear ROOTers,
> > > is there a way to control the number of axis values plotted?
> > >
> > > In the attached example I would like to have only the values 0, 2, 4, 6,
> > > 8 and 10 plotted next to the axis of the first histogram whose axis
> > > ranges from 0 to 10. Having all integer values from 0 to 6 on an axis from
> > > 0 to 6 (second histogram) is fine.
> > > As you can see, I found a small trick (third histogram), but that does not
> > > solve my general problem that I sometimes want to divide the umber of
> > > plotted lables by two.
> > > I did not manage with TAxis->SetNdivisions(...) ...
> > >
> > > Cheers
> > >
> > > Gero

-- 
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail: Olivier.Couet_at_cern.ch                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7670300
Received on Mon May 29 2006 - 17:36:41 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET