// Batcurve with root. A fail. TCanvas *batcurve(){ TF2 * links = new TF2("links","(((x/7) ** 2) * sqrt(abs(abs(x) - 3)/(abs(x) - 3)) + ((y / 3) ** 2) * sqrt(abs(y + (3 * sqrt(33)) / 7)/(y + (3 * sqrt(33)) / 7)) - 1) * (abs(x/2) - ((3 * sqrt(33) - 7)/112) * x**2 - 3 + sqrt(1 - (abs(abs(x) - 2) - 1) ** 2 ) - y) * (9 * sqrt(abs((abs(x) - 1) * (abs(x) - 3/4))/((1 - abs(x)) * (abs(x) - 3/4))) - 8 * abs(x) - y)", -10,10,-3,3); TF2 * links2 = new TF2("links2","(abs(x/2) - ((3 * sqrt(33) - 7)/112) * x**2 - 3 + sqrt(1 - (abs(abs(x) - 2) - 1) ** 2 ) - y) * (9 * sqrt(abs((abs(x) - 1) * (abs(x) - 3/4))/((1 - abs(x)) * (abs(x) - 3/4))) - 8 * abs(x) - y)", -10,10,-3,3); TCanvas* c = new TCanvas("c","Contour",0,0,600,600); Double_t nOfcontours[1]; nOfcontours[0] = 0; // nOfcontours[1] = 1; // nOfcontours[2] = 2; links->SetContour(1, nOfcontours); links2->SetContour(1, nOfcontours); links->Draw("CONT LIST"); c->Update(); TObjArray *contours = gROOT->GetListOfSpecials()->FindObject("contours"); Int_t ncontours = contours->GetSize(); TList *list = (TList*)contours->At(0); TGraph *gr1 = (TGraph*)list->First(); gr1->SetLineColor(kBlue); TGraph * gc = NULL gc = (TGraph*)gr1->Clone(); links2->Draw("CONT LIST"); c->Update(); TObjArray *contours2 = gROOT->GetListOfSpecials()->FindObject("contours"); Int_t ncontours2 = contours2->GetSize(); TList *list2 = (TList*)contours2->At(0); TGraph *gr2 = (TGraph*)list2->First(); gr2->SetLineColor(kRed); TGraph * gc2 = NULL gc2 = (TGraph*)gr2->Clone(); TCanvas* c2 = new TCanvas("c2","Contour2",0,0,600,600); gc->SetLineWidth(1); gc2->SetLineWidth(1); TMultiGraph *mg = new TMultiGraph(); mg->Add(gc,"c"); mg->Add(gc2,"c"); mg->Draw("a"); }