Hello everyone,
I am having trouble accessing the labels of secondary tick marks in a log axis. In practice, I would like to keep the primary tick mark labels, and some of the secondary ones. I provide an example below:
TH1D *h = new TH1D("h", "some histogram", 5, 0, 2.1);
for (int i=0; i<5; i++) {
for (int j=0; j<=i; j++) h->Fill(i*0.42);
}
h->GetXaxis()->SetTitle("ln(0.4/x)");
TCanvas *c = new TCanvas("c", "second axis", 800, 600);
h->Draw();
c->SetBottomMargin(0.3);
auto axis = new TGaxis(2.1, 0.02, 0. ,0.02, 0.048982571, 0.4, 2,"NIGS-");
axis->SetTitle("x");
axis->CenterTitle();
axis->SetTitleFont(43);
axis->SetTitleSize(20);
axis->SetTitleOffset(1.2);
axis->SetLabelFont(43);
axis->SetLabelSize(20);
axis->SetLabelOffset(0.05);
axis->SetTickSize(0.02);
axis->SetMoreLogLabels(); // add the secondary tick labels
// axis->ChangeLabel(1,-1,-1,-1,-1,-1,"-#pi");
axis->ChangeLabel(510,-1,-1,-1,-1,-1,"this");
axis->SetNoExponent();
axis->Draw();
So the second axis is a log axis, where I want to keep from the secondary tick labels the 0.4, 0.3, 0.2 and 0.05, and get rid of the ones between 0.05 and 0.1, but with ChangeLabel() so far I have only managed to access the primary tick mark 0.1.
I am using ROOT 6.14 and can easily access up to 6.28.
Thanks in advance,
Lida
ROOT Version: 6.14
Platform: Centos 7