Bar histogram revisited

Hello

Below is a macro drawing a bar histograms and I would like
to improve its result. This brings three questions.

1 Is is possible to draw tickmark labels at 5, 10, and 50?

  1. Is it possible to SetMoreLogLabels in this macro?

  2. Is it possible to SetNDivisions in this macro?

I appreciate any hints.

Michal

int BarHist()
{

TCanvas *CC = new TCanvas(“BarHist”, “Bar Hist”, 600, 600);
gPad -> SetLogx();
gPad -> DrawFrame(5, 0, 50, 120);
const Int_t NHistsA = 4;
Double_t XXA[NHistsA] = {14.1, 15.4, 16.8, 18.4};
Double_t YYA[NHistsA] = { 97, 100, 65, 15};

for (Int_t il = 0; il < NHistsA; il++) {
TLine *Line = new TLine(XXA[il], 0, XXA[il], YYA[il]);
Line -> SetLineWidth(6);
Line -> Draw();
}
CC -> Update();
}

You can call SetMoreLogLabels

{

        TCanvas *CC = new TCanvas("BarHist", "Bar Hist", 600, 600);
        gPad -> SetLogx();
        gPad -> DrawFrame(5, 0, 50, 120);
        hframe->GetXaxis()->SetMoreLogLabels();
        const Int_t NHistsA = 4;
        Double_t XXA[NHistsA] = {14.1, 15.4, 16.8, 18.4};
        Double_t YYA[NHistsA] = { 97, 100, 65, 15};

        for (Int_t il = 0; il < NHistsA; il++) {
                TLine *Line = new TLine(XXA[il], 0, XXA[il], YYA[il]);
                Line -> SetLineWidth(6);
                Line -> Draw();
        }
        CC -> Update();
}

Note that in order to learn how to change an attribute of any editable object, try to modify it using the editor of the context menu; then save the result as a “.C” file and see what you need to do in a macro to obtain the result you got interactively.