Re: Set fewer log labels?

From: Seth Zenz <sczenz_at_lbl.gov>
Date: Tue, 21 Jun 2011 15:32:14 -0700


Hi Oliver,

Here's a simple example:

    TH1F * test = new TH1F("test","test",2,0.0,2.0);     test->SetBinContent(2,0.7);
    test->SetBinContent(1,3e15);

    TCanvas *c1 = new TCanvas("c1","c1",600,600);     c1->SetLogy();

    test->Draw("e");
    c1->SaveAs("test1.png");

    test->GetYaxis()->SetNdivisions(7);
    test->Draw("e");
    c1->SaveAs("test2.png");

test1.png ends up looking just the way I want, except that I wish to remove every second label -- in particular the tick marks are as I prefer. Now, test2.png, when SetNdivisions is used, has only every second label -- but there are now too few "minor" tick marks. Playing around with secondary and tertiary divisions did not change them in the slightest.

I have not been able to find any documentation on the behavior of SetNdivisions for log scales. Is there any?

Thanks,
Seth

On Sun, Jun 19, 2011 at 11:45 PM, Olivier Couet <Olivier.Couet_at_cern.ch> wrote:
> Have you tried to change de number of divisions ?
> Can you provide a small example showing the problem ?
> Cheers,
> O.Couet
>
> On 6/19/11 4:27 AM, "Seth Zenz" <sczenz_at_lbl.gov> wrote:
>
>>Hi Root experts,
>>
>>Is there are straightforward way to only label every second decade on
>>a log plot?  That is, I want the same tick marks as the default, but
>>for example 10^14 and 10^12 would appear but 10^13 would not.
>>
>>Thanks,
>>Seth Zenz
>>
>
>
Received on Wed Jun 22 2011 - 00:32:24 CEST

This archive was generated by hypermail 2.2.0 : Wed Jun 22 2011 - 05:50:01 CEST