How to title the y axis in a pad

hi

my question is how can i titel the y-axis in my pad.

pad1->DrawFrame(-6,0,8,2);
pad1->GetFrame()->SetFillColor(19);
TLatex *t = new TLatex();
t->SetNDC();
t->SetTextFont(62);
t->SetTextColor(36);
t->SetTextSize(0.08);
t->SetTextAlign(12);
t->SetTextSize(0.05);
t->SetTextColor(1);
t->DrawLatex(0.6,0.06,“Y_{#pi +}”); //X-Axis Titel

thx for helping

Do, for example:

{ TCanvas *pad1 = new TCanvas("pad1"); TH1 *frame = pad1->DrawFrame(-6,0,8,2); frame->GetYaxis()->SetTitle("Y_{#pi +}"); pad1->Modified(); }

Rene

Hi,

You could use the user interface for setting/changing the axis title and other axis attributes. You can activate the graphics editor via View menu / Editor once you have your drawing in the canvas. The editor will appear on the left side of the canvas window and will provide user interface according to the selected object in the canvas. Click on the Y-axis with left mouse button to make it the selected and type the title string Y_{#pi +} in the text entry field.

You can see the picture of axis editor at root.cern.ch/root/htmldoc/TAxisEditor.html

Best regards, Ilka