TGraph2D

Dear Rooters:
I am wondering about how to put labels on to my 3D graph produced by TGraph2D. Below is how I have tried to include labels but does not work.

TCanvas *c4 = new TCanvas(“c4”, “Graph Draw Options”, 200, 10, 600, 400);
TGraph2D *tgraphI = new TGraph2D(“tgraphI”, “”, Nevents, w, y, z);
//tgraphI->SetTitle(“three dimensional plot” );
tgraphI->GetXaxis( )->SetTitle(“CosThetaZ”);
tgraphI->GetYaxis( )->SetTitle(“Energy”);
tgraphI->GetZaxis( )->SetTitle(“Probability”);
tgraphI->Draw(“surf1”);

Thank you,
~karla

You can use the TGpah2D method:

TH2D *GetHistogram

to get a TH2 from the TGpah2D. Then change the titles etc… on the TH2 and plot it with option SURF1 (as you do now)

The following functions have been added to TGraph2D in CVS:
TAxis *GetXaxis() const ;
TAxis *GetYaxis() const ;
TAxis *GetZaxis() const ;

Rene