ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
May someone teach me how to set a axis like this picture which Xaxis has same length but different labels?
Please, I have tried many ways but they didn’t work.
thank you!
May someone teach me how to set a axis like this picture which Xaxis has same length but different labels?
Please, I have tried many ways but they didn’t work.
thank you!
{
auto h = new TH1F("h","h",100,0.,1.);
h->Draw();
auto Xaxis = h->GetXaxis();
Xaxis->SetNdivisions(-9);
Xaxis->ChangeLabel(1,-1,-1,-1,-1,-1,"20");
Xaxis->ChangeLabel(2,-1,-1,-1,-1,-1,"35");
Xaxis->ChangeLabel(3,-1,-1,-1,-1,-1,"50");
Xaxis->ChangeLabel(4,-1,-1,-1,-1,-1,"65");
Xaxis->ChangeLabel(5,-1,-1,-1,-1,-1,"80");
Xaxis->ChangeLabel(6,-1,-1,-1,-1,-1,"95");
Xaxis->ChangeLabel(7,-1,-1,-1,-1,-1,"110");
Xaxis->ChangeLabel(8,-1,-1,-1,-1,-1,"140");
Xaxis->ChangeLabel(9,-1,-1,-1,-1,-1,"180");
Xaxis->ChangeLabel(10,-1,-1,-1,-1,-1,"300");
}
Thank you!
It works!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.