TGraph2D axis Title

Hello
I try to get Axis Titels for a 2D Graph but The command

g1->GetZaxis()->SetTitle(“Mpc”);

does not work. I created a example program below together with the error messages… Thanks for any help
best regards
florian

#include <math.h>
#include <string.h>
#include <algorithm>
#include <fstream>
#include <iostream>

void test(){		//V = 20fm^3 and T=120-220MeV
   gROOT->SetStyle("Plain");
   gStyle->SetOptStat(0);

   int n;
   double dummy = 15.6;

   TCanvas *view = new TCanvas("view", "6df-survey", 0, 0, 750, 600);    

   TGraph2D *g1 = new TGraph2D();

   n = 0;
   while(n < 3){
      g1->SetPoint(n,dummy+n,dummy-n,dummy+2.*n);

      n++;
   }

   g1->SetTitle("");
   g1->GetXaxis()->SetTitle("Mpc");
   g1->GetYaxis()->SetTitle("Mpc");
   g1->GetZaxis()->SetTitle("Mpc");
   g1->GetXaxis()->CenterTitle();
   g1->GetYaxis()->CenterTitle();
   g1->GetZaxis()->CenterTitle();
   g1->SetMarkerSize(1);
   g1->SetMarkerColor(1);
   g1->SetMarkerStyle(1);
   g1->SetTitle("");

   g1->Draw("P");
} 


error messages:
root [1] .x test.C
Warning: template pair duplicate definition /usr/lib/root/5.18/cint/stl/_pair.h:31:
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.0125 -0.0125 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.0375 -0.0375 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.0625 -0.0625 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.1625 -0.1625 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.1875 -0.1875 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.2875 -0.2875 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.3125 -0.3125 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.3375 -0.3375 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.4125 -0.4125 1
Error in <TGraphDelaunay::Interpolate>: Point outside hull when expected inside: this point could be dodgy 0.4875 -0.4875 1
Error in <TView3D::ResetView>: Error in min-max scope
Error in <TView3D::ResetView>: Error in min-max scope
Error in <TView3D::ResetView>: Error in min-max scope
Error in <TView3D::SetRange>: problem setting view
Error in <TView3D::ResetView>: Error in min-max scope
Error in <TCanvas::Range>: illegal world coordinates range: x1=-0.000000, y1=-0.000000, x2=0.000000, y2=0.000000
Error in <TCanvas::RangeAxis>: illegal axis coordinates range: xmin=-0.000000, ymin=-0.000000, xmax=0.000000, ymax=0.000000

Your points are on a line. No interpolation is possible. The underlying histogram cannot created. Workaround:

{
   gROOT->SetStyle("Plain");
   gStyle->SetOptStat(0);

   int n;
   double dummy = 15.6;

   TCanvas *view = new TCanvas("view", "6df-survey", 0, 0, 750, 600);

   TGraph2D *g1 = new TGraph2D();

   n = 0;
   while(n < 3){
   g1->SetPoint(n,dummy+n,dummy-n,dummy+2.*n);
   n++;
   }

   g1->SetTitle("g1");
   g1->GetHistogram("empty")->GetXaxis()->SetTitle("Mpc");
   g1->GetHistogram("empty")->GetYaxis()->SetTitle("Mpc");
   g1->GetHistogram("empty")->GetZaxis()->SetTitle("Mpc");
   g1->GetHistogram("empty")->GetXaxis()->CenterTitle();
   g1->GetHistogram("empty")->GetYaxis()->CenterTitle();
   g1->GetHistogram("empty")->GetZaxis()->CenterTitle();
   g1->SetMarkerSize(1);
   g1->SetMarkerColor(1);
   g1->SetMarkerStyle(1);
   g1->SetTitle("");

   g1->Draw("P0");
}

thank you very much…