Drawing TMarkers on TH2 with Aitoff projection

Hi,

I would like to draw a skymap using TMarkers (or other points/symbols) stacked on top of a TH2 drawn with the Aitoff projection. In my example code below, the TMarker is not drawn if I include the option “z aitoff” when drawing the TH2. If I draw the TH2 without this option, the TMarker appears.

void drawSkymap()
{
  int n_hbins=180;
  TH2F *skymap = new TH2F("skymap","skymap", n_hbins, -180, 180, n_hbins-1, -89.5, 89.5);

  TCanvas *c1=new TCanvas("c1","c1",0,0,400,400);
  c1->cd();

  skymap->Fill(30,30); // some dummy values 
  skymap->Fill(60,60);

  TMarker* myMarker = new TMarker(-30,-30,7);
  myMarker->SetMarkerSize(20);
  myMarker->SetMarkerColor(3);

  skymap->Draw("z aitoff");
  myMarker->Draw("same");
}

Is the “z aitoff” option overwriting something behind the scenes? Is there a better way to draw points or markers on a skymap? I have tried using TGraph instead, but basically have the same problem.

Thank you!
-Michael

See:

Thank you, that works!