void smallReproducible() { TFile* rootFile = TFile::Open("ElevationB.root"); TFile* treeFile = TFile::Open("ArcherTree.root"); TGraph2D* BSeaLevel = new TGraph2D(360*720); //2D array with N rows and M cols rootFile->GetObject("Bathymetry_overlay", BSeaLevel); TTree* archerTree = new TTree("archerTree", "archerTree"); // Tree with branches such as "CaCO3" and "BathDepth", and are used in TCut treeFile->GetObject("ARCHERTREE", archerTree); //Cuts that I would like to use but produce desired axes limits TCut cutDepth2030 = "(CaCO3 != -999 && BathDepth > 2000 && BathDepth < 3000)*(abs(CaCO3))"; TCut cutInd = "longit >= 30 && longit <120 && latit >= -55 && latit < 15"; TCanvas* c2 = new TCanvas( "c2", "Elevation Overlay", 500, 500 ); //BSeaLevel->GetXaxis()->SetTitle("latitude"); BSeaLevel->GetYaxis()->SetTitle("longitude"); BSeaLevel->GetZaxis()->SetTitle("z"); TH3F* h = new TH3F( "h", "BathDepth vs longitude vs latitude", 100, 0., -1., 100, 0., -1., 100, 0., -1. ); //archerTree->Project( "h", "(BathDepth*-1):longit:latit", cutDepth2030 && cutInd ); //archerTree->Draw("BathDepth:longit:latit", cutDepth2030 && cutNat, "SURF2"); archerTree->Project( "h", "(-1*BathDepth):(longit):latit" ); h->GetXaxis()->SetTitle("latitude"); h->GetYaxis()->SetTitle("longitude"); h->GetZaxis()->SetTitle("z"); h->SetMarkerColor(2); h->SetMarkerStyle(20); h->SetMarkerSize(1); h->GetXaxis()->SetLimits( -90.,90. ); h->GetYaxis()->SetLimits( -180.,180. ); h->GetZaxis()->SetLimits( -8000.,0. ); //h->GetXaxis()->SetRange( -90,90 ); h->GetYaxis()->SetRange( -180,180 ); h->GetZaxis()->SetRange( -7000,0 ); h->Draw(); BSeaLevel->Draw("SURF5SAME"); }