Axes

Hi,
I am having a problem with the way the y-axis is displayed, it begins at zero but compresses the axis from 0 to 1 and then it becomes normal, in another way, the “ticking” is not even, or symmetric if you like on both sides of the value 1.0 .
below is the code and the plot is attached.

void hQ_All()
{
//Create a canvas
TCanvas *hQ_All = new TCanvas(“hQ_All”,"Q-Factor for all events ",800,700);
hQ_FC_All->SetLineColor(kGreen);
gStyle->SetOptStat(kFALSE);
hQ_FC_All->SetTitle(“Q-Factor for all events”);
hQ_FC_All->GetXaxis()->SetTitle(“Compactness(nb2/mxPE)”);
hQ_FC_All->GetYaxis()->SetTitle(“Q-Factor”);
hQ_FC_All->Draw();
hQ_TC_All->SetLineColor(kBlack);
//hQ_TC_All->Draw(“Same”);

gPad->SetFillColor(10);

TLegend *legend = new TLegend(0.68,0.84,0.99,0.98);
legend->SetFillColor(kWhite);
legend->AddEntry(“hQ_FC_All”,“Multiplicity Trigger of 50 PMTs”,“l”);
// legend->AddEntry(“hQ_FC_All”,“Fit Core”,“l”);
legend->SetTextSize(0.02);
legend->Draw();

}
hQ_All_OldX2.ps (10 KB)

I am not sure to understand fully what kind of labelling you would like along the Y axis. Seems to me what I see on the ps file you sent if fine. The label “0” is not on the Y axis but on the X axis.

Thanks for your reply,
what I am trying to do is to set the range of the Y axis to (0.0,2.0), I already did this with the SetRange() command, but still I get the same plot, I quitted rrot and started it again and got the same result!

Do:

hQ_FC_All->SetMinimum(0);
hQ_FC_All->SetMaximum(2);

Rene

Thanks alot Rene, that worked :laughing: