Re: SetNdivisions

From: Gero FLUCKE <flucke_at_mail.cern.ch>
Date: Thu, 12 Oct 2006 09:04:05 +0200 (CEST)


On Wed, 11 Oct 2006, Francois-Xavier Girod wrote:

>
> Dear rooters,
>
> I am using ROOT 5.16.13, gcc version 3.4.6, (Red Hat 3.4.6-3).
>
> My goal is to draw an histogram with X-axis from 0 to 360 with nice
> looking divisions like (0,90,180,270,360).
>
> If I do :
>
> TH1F *toto = new TH1F("toto","toto",100,0,360);
> toto->GetXaxis()->SetNdivisions(404,'N');
> toto->Draw();
>
> I can't make it work (neither on other versions of root by the way). I
> tried it interactively, and found that :
>
> TH1F *toto = new TH1F("toto","toto",100,0,360);
> toto->GetXaxis()->SetNdivisions(404,kFALSE);
> toto->Draw();
>
> does the job.
>
> Is this the expected behavior ?
> Thank you for your help.

Dear Francois-Xavier,
yes, it is. Note that 'N' in your failing example is a char != 0, so it converts to kTRUE which means

toto->GetXaxis()->SetNdivisions(404,'N');

is in fact

toto->GetXaxis()->SetNdivisions(404, kTRUE);

Cheers

        Gero Received on Thu Oct 12 2006 - 09:04:22 MEST

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