Hi,
I am changing the bin label from numbers to strings. I copy a simple test macro below. How can I have the strings with the same font size as the numbers?
void test()
{
gInterpreter->ExecuteMacro("PaperStyle.C");
TH1F* hist1 = new TH1F("hist1", "", 5, -0.5, 4.5);
TH1F* hist2 = new TH1F("hist2", "", 5, -0.5, 4.5);
TCanvas* c1 = new TCanvas("c1", "c1");
hist1->Draw();
c1->SaveAs("number.png");
TAxis* xaxis = hist2->GetXaxis();
for (int i=1; i<=xaxis->GetNbins(); i++)
xaxis->SetBinLabel(i, "qwerty");
TCanvas* c2 = new TCanvas("c2", "c2");
hist2->Draw();
c2->SaveAs("strings.png");
}
Thanks,
Jonatan