{ const double multiply_f = 5.0; //depression in pp const Int_t n = 3;//0.001, 0.1, 0.3, 0.5, 1.0 Double_t x[n] = {30, 80, 130}; Double_t y[n] = {0.0395622, 0.0454451, 0.0359729}; Double_t ex[n] = {0, 0, 0}; Double_t ey[n] = {0.0101898, 0.0101015, 0.00633634}; for(int i=0; i<3; i++) { y[i] *= multiply_f; ey[i] *= multiply_f; } TGraphErrors *dep_pp = new TGraphErrors (n, x, y, ex, ey); dep_pp->SetLineColor(1); dep_pp->SetLineStyle(1); dep_pp->SetLineWidth(4); //dep_pp->SetMarkerStyle(20); //dep_pp->SetMarkerColor(1); //Draw the diagram---------------------------------------------------------------------------- TCanvas* csub1 = new TCanvas("csub1", "", 600, 600); csub1->Divide(1,1, 0, 0); csub1->cd(1)->SetTicks(1,1); csub1->cd(1)->SetPad(0.02, 0.02, 0.98, 0.99); csub1->cd(1)->SetTopMargin(0.10); csub1->cd(1)->SetBottomMargin(0.18); csub1->cd(1)->SetLeftMargin(0.15); csub1->cd(1)->SetRightMargin(0.05); csub1->cd(1); //csub1->cd(1)->SetLogy(); TH1D* hsub1 = new TH1D("hsub1", ";; ", 205, 0, 205); hsub1->SetLineWidth(0); hsub1->SetStats(kFALSE); hsub1->GetXaxis()->CenterTitle(); hsub1->GetYaxis()->CenterTitle(); hsub1->GetXaxis()->SetTitleOffset(1.02); hsub1->GetYaxis()->SetTitleOffset(1.15); hsub1->GetXaxis()->SetLabelOffset(0.01); hsub1->GetYaxis()->SetLabelOffset(0.01); hsub1->GetXaxis()->SetTitleSize(0.08); hsub1->GetYaxis()->SetTitleSize(0.08); hsub1->GetXaxis()->SetTitleFont(42); hsub1->GetYaxis()->SetTitleFont(42); hsub1->GetXaxis()->SetLabelFont(42); hsub1->GetYaxis()->SetLabelFont(42); hsub1->GetXaxis()->SetLabelSize(0.06); hsub1->GetYaxis()->SetLabelSize(0.06); hsub1->GetYaxis()->SetRangeUser(-0.05, 1.38); hsub1->GetXaxis()->SetNdivisions(505); hsub1->Draw(); TF1* data_line = new TF1("data_line", "0.0",0, 500); data_line->SetLineColor(1); data_line->SetLineWidth(3); data_line->SetLineStyle(3); data_line->Draw("Lsame"); //TLegend* lgdsub1 = new TLegend(0.22, 0.67, 0.57, 0.87); TLegend* lgdsub1 = new TLegend(0.22, 0.67, 0.55, 0.87); lgdsub1->SetTextSize(0.040); lgdsub1->SetBorderSize(0); lgdsub1->SetHeader("#LTnsd#GT"); lgdsub1->AddEntry(dep_pp, " ", "L E"); //gr->Draw("pEsame"); dep_pp->Draw("LEsame"); }