Hi Giuseppe,
See example in $ROOTSYS/tutorials/graph.C
http://root.cern.ch/root/html/examples/graph.C.html
Rene Brun
Giuseppe.LoRe@ct.infn.it wrote:
>
> Hi, i have a little problem with TGraph.
> How can i put a title to an axis?
> I try with ...->GetXaxis()->SetTitle("..") but i obtain
> Error: illegal pointer to class object GetXaxis() 0x0 122.
>
> TGraph *mltplct_gr1 = new TGraph(12, Zv, z1);
> mltplct_gr1->SetLineColor(2);
> mltplct_gr1->SetLineWidth(2);
> mltplct_gr1->SetMarkerColor(4);
> mltplct_gr1->SetMarkerStyle(21);
> mltplct_gr1->GetXaxis()->SetTitle("Zv");
> mltplct_gr1->SetTitle("Moltiplicity versus primary vertex position\n");
> mltplct_gr1->Draw("ACP");
>
> Best regards, Giuseppe Lo Re.
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:33 MET