{ gROOT->Reset(); Int_t n = 20; Double_t x[n], y[n], x1[n], y1[n]; // create the blue graph with a cos function for (Int_t i=0;iFillRandom("gaus",100000); g->FillRandom("gaus", 90000); /* TGraph *gr1 = new TGraph(n,x,y); TGraph *gr2 = new TGraph(n,x1,y1); */ TGraph *gr1 = new TGraph(h); TGraph *gr2 = new TGraph(g); cout << gr2->GetHistogram()->GetMaximum() << endl; TCanvas *c1 = new TCanvas ("c1","Two Graphs" , 200, 10, 600, 400); // draw the graph with axis,contineous line, and // put a * at each point gr1->SetLineColor(4); gr1->Draw("AC*"); cout << gr1->GetHistogram()->GetMaximum() << endl; // superimpose the second graph by leaving out // the axis option "A" gr2->SetLineWidth(3); gr2->SetMarkerStyle(21); gr2->SetLineColor(2); gr2->Draw("CP"); }