{ #include #include c1 = new TCanvas("c1","A Simple Graph with error bars",0,0,700,500); c1->SetFillStyle(4100); c1->SetGrid(); c1->GetFrame()->SetBorderSize(12); TStyle *default = new TStyle("Default","Default Style"); //default->SetPadBorderMode(0); default->SetCanvasColor(0); default->cd(); // this becomes now the current style gStyle // create the arrays for the points Int_t n = 13; Double_t x[n], y4[n],y5[n],y6[n],y7[n],y8[n],y9[n],y10[n]; ifstream fin("ShutdownEffects.txt"); for (int i=0; i> x[i] >> y4[i]>> y5[i]>>y6[i]>>y7[i]>>y8[i]>>y9[i]>>y10[i]; fin.close(); // g1 = new TGraph(n,x, y4); g2 = new TGraph(n,x, y5); g3 = new TGraph(n,x, y6); g4 = new TGraph(n,x, y7); g5 = new TGraph(n,x, y8); g6 = new TGraph(n,x, y9); g7 = new TGraph(n,x, y10); g1->SetTitle(); g1->SetLineColor(1);g1->SetMarkerColor(1); g2->SetLineColor(2);g1->SetMarkerColor(2); g3->SetLineColor(3);g1->SetMarkerColor(3); g4->SetLineColor(4);g1->SetMarkerColor(4); g5->SetLineColor(1);g1->SetMarkerColor(1); g6->SetLineColor(6);g1->SetMarkerColor(6); g7->SetLineColor(7);g1->SetMarkerColor(7); Double_t ymax= 300., xmax=180., ymin=0; g1->SetMaximum(ymax); g1->SetMinimum(ymin); g1->GetYaxis()->SetTitle("V_{d} at the 11th year-end [V]"); g1->GetXaxis()->SetTitle("warm days at 20^{o}C during the shutdown year"); g1->GetYaxis()->SetTitleSize(0.04); g1->GetYaxis()->SetTitleFont(132); g1->GetYaxis()->SetLabelSize(0.04); g1->GetYaxis()->SetLabelFont(132); g1->GetXaxis()->SetTitleSize(0.04); g1->GetXaxis()->SetTitleFont(132); g1->GetXaxis()->SetLabelSize(0.04); g1->GetXaxis()->SetLabelFont(132); g1->GetYaxis()->SetTitleOffset(1.2); g1->GetXaxis()->SetTitleOffset(1.0); g1->GetXaxis()->SetRangeUser(0,xmax); //g1->GetXaxis()->SetNdivisions(Int_n=7); g1->Draw("ALP"); g2->Draw("SAME LP"); g3->Draw("SAME LP"); g4->Draw("SAME LP"); g5->Draw("SAME LP"); g6->Draw("SAME LP"); //g7->Draw("SAME LP"); //---------------------------------------------------- TLine x9( 0,0,xmax,0); x9->SetLineStyle(1); x9->SetLineWidth(2); x9->Draw(); TLine xa( 0,0,0,ymax);xa->SetLineStyle(1);xa->SetLineWidth(2);xa->Draw(); TLine xb( 0,ymax,xmax,ymax);xb->SetLineStyle(1);xb->SetLineWidth(2);xb->Draw(); TLine x8(xmax,0, xmax,ymax); x8->SetLineStyle(1); x8->SetLineWidth(2);x8->Draw(); // Double_t q1=0.5, q2=0.8, q3=1.1, q4=1.5 , q5=4.2, q6=2.4, q7=4.5, q8=5.5; // t=new TLatex(142,230,"Shutdown year");t->SetTextFont(132); t->SetTextSize(0.035); t->Draw(); t=new TLatex(145,210,"9 th");t->SetTextFont(132); t->SetTextSize(0.035); t->Draw(); t=new TLatex(150,187,"8 th");t->SetTextFont(132); t->SetTextSize(0.035); t->Draw(); t=new TLatex(160,135,"4 th year");t->SetTextFont(132); t->SetTextSize(0.035); t->Draw(); t=new TLatex(10,280, "B3, Hamburg model, Cooling scenario B except the shutdow year"); t->SetTextFont(132); t->SetTextSize(0.040); t->Draw(); // // leg = new TLegend(0.12 ,0.13 ,0.45,0.45 ); leg->SetFillColor(10);leg->SetBorderSize(2);leg->SetTextFont(132); leg->SetTextSize(0.04); leg->SetHeader("Vd rise by one-year shutdown"); leg->AddEntry(t,"shutdown year",""); leg->AddEntry(g1,"4 th year","l"); leg->AddEntry(g2,"5 th year","l"); leg->AddEntry(g3,"6 th year","l"); leg->AddEntry(g4,"7 th year","l"); leg->AddEntry(g5,"8 th year","l"); leg->AddEntry(g6,"9 th year","l"); leg->Draw(); }