Hi
I am trying to set the title when I am piling up my TGraphs objects in a TMultiGraph object, but honestly, I do not have clear how to set up the tiltel of the output plot.
This is a chucnk of my code and then at the end you will see what I tried to set up the title. How should I do it?
Cristian
TMultiGraph *mg = new TMultiGraph();
for (Int_t ii=1;ii<PK_A;ii=ii+3){
for (Int_t jj=1;jj<=cplots;jj++){
if (x[jj]!=0){
y[jj] = fitResults[jj][ii];
volts[jj]=x[jj];
}
}
gr=new TGraph(cplots,volts,y);
mg->Add(gr);
}
//nothing happens
xaxis = gr->GetXaxis();
xaxis->SetTitle(“Voltage [kV]”);
yaxis = mg->GetYaxis();
gr->SetTitle(“Peak position”);
mg->Draw(“ap*l”)