ROOT Version: 6.26/02
Platform: Windows
Compiler: MSVC 19.31.31104.0
Hi,
I can’t get it done to plot an axis logarithmically. The code is:
Double_t partEdep;
tree = myFile->Get<TTree>("depE_sum");
tree->SetBranchAddress("fdepEnergy_sum", &partEdep);
auto HdepEnergy = new TH1F("HdepEnergy", "Histo_depE", 10000, 0.0001, 1.);
for (int iEntry = 0; iEntry < tree->GetEntriesFast(); ++iEntry)
{
tree->GetEntry(iEntry);
HdepEnergy->Fill(partEdep);
}
TCanvas* c2 = new TCanvas("c2", "", 20, 20, 1000, 500);
c2->Divide(1,4);
c2->cd(1);
c2->SetLogx();
HdepEnergy->Draw("EHIST");
HdepEnergy->SetFillColor(kCyan-2);
HdepEnergy->SetLineColor(kOrange-3);
HdepEnergy->GetXaxis()->SetTitle("[keV]");
c2->SetLogx();
It’ll always plot regularly. Could you please tell me what I am doing wrongly?
Thanks in advance!