int test_cont2() { TH2D * h2d = new TH2D("h2d", "", 40, -1, 1, 40, -1, 1); for (int ievt=0; ievt<100000; ievt++) { h2d->Fill(gRandom->Gaus(0,0.3), gRandom->Gaus(0,.3)); } TCanvas * can = new TCanvas("can", "can", 800, 600); h2d->Draw("cont LIST"); //if using 'cont2', no contours found, then //how to get information like line style ?? //If using 'cont', contours can be found can->Update(); // Get Contours TObjArray *conts = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours"); TList* contLevel = NULL; TGraph* curv = NULL; TGraph* gc = NULL; Int_t nGraphs = 0; Int_t TotalConts = 0; if (conts == NULL){ printf("*** No Contours Were Extracted!\n"); TotalConts = 0; return; } else { TotalConts = conts->GetSize(); } printf("TotalConts = %d\n", TotalConts); for(i = 0; i < TotalConts; i++){ contLevel = (TList*)conts->At(i); printf("Contour %d has %d Graphs\n", i, contLevel->GetSize()); nGraphs += contLevel->GetSize(); } }