SetBinLabel and TGraphErrors

Hello, I am plotting data with the TGraphErrors class, and I would change the labels on the X axis. Accordingly to the macro I found in the tutorial directory, I do:

[…]
Char_t *Aname[num_data] = {“A0”,“A1”,“A2”,“A3”,“A4”,“A5”,“A6”,“A7”,“A8”};

TCanvas *c1 = new TCanvas(“c1”,“demo bin labels”,1000,100,900,500);
c1->SetGrid();
c1->SetBottomMargin(0.15);

TGraphErrors *A_Side = new
TGraphErrors(num_data,Colum,ARati,EColu,EARat);

for (i=1;i<=num_data;i++) {
A_Side->GetXaxis()->SetBinLabel(i,Aname[i-1]);
}

A_Side->SetMarkerColor(1);
A_Side->SetMarkerStyle(29);
A_Side->SetMarkerSize(1.4);
A_Side->SetLineWidth(1.5);
A_Side->Draw(“PA”);

You can see what I get looking at the file attached here. Labels are changed, sure, but in principle I would like to write under each point the label… Can you help me?
Thanks ain advance!
Regards
Davide


If you have bins, use a TH1F, not a TGraphErrors if you want to set the bins label

Rene

Hi thanks a lot, it works now.
But I woulkd like to plot also the errors of the points I have and this is why I was using the TGraphErrors environment. What can I do?
Davide

simply call myhist.SetBinError(bin,error)

Rene