Why there are vertical lines along the data points in the diagram. can,t these four histograms be shown as dark lines?
void Hist1_Thdata() {
THStack *hs = new THStack("hs", "Stacked data for various energies;energy(mev);cross section(b/mev)");
const int n = 648;
double en[n], cs[n];
FILE *thfile = fopen("thor.txt", "r");
TH1D *h1 = new TH1D("h1", "2.03 MeV", 174, 0.04, 17.6);
h1->SetStats(0);
h1->SetLineColor(kBlue);
h1->Sumw2();
TH1D *h2 = new TH1D("h2", "4.25 MeV", 334, 0.04, 17.6);
h2->SetStats(0);
h2->SetMarkerStyle(11);
h2->SetMarkerSize(0.2);
h2->SetMarkerColor(kGreen);
h2->SetLineColor(kGreen);
h2->Sumw2();
TH1D *h3 = new TH1D("h3", "6.1 MeV", 494, 0.04, 17.6);
h3->SetStats(0);
h3->SetMarkerStyle(31);
h3->SetMarkerSize(0.2);
h3->SetMarkerColor(kRed);
h3->SetLineColor(kRed);
h3->Sumw2();
TH1D *h4 = new TH1D("h4", "14.5 MeV", 648, 0.04, 17.6);
h4->SetStats(0);
h4->SetMarkerStyle(41);
h4->SetMarkerSize(0.2);
h4->SetMarkerColor(kBlack);
h4->SetLineColor(kBlack);
h4->Sumw2();
for (int t = 0; t < n; t++) {
fscanf(thfile, "%lf %lf \n", &en[t], &cs[t]);
if (t < 174)
h1->Fill(en[t], cs[t]);
else if (t < 334)
h2->Fill(en[t], cs[t]);
else if (t < 494)
h3->Fill(en[t], cs[t]);
else
h4->Fill(en[t], cs[t]);
}
fclose(thfile);
TCanvas *c = new TCanvas("c", "90-TH-232(N,X)O-NN-1,,DE", 800, 500);
gPad->SetLogx();
gPad->SetLogy();
c->SetGridx();
c->SetGridy();
c->SetTickx(1);
c->SetTicky(1);
c->SetFrameFillColor(0);
c->SetFrameFillStyle(3003);
c->SetFrameLineColor(5);
c->SetFrameLineWidth(2);
c->SetFrameBorderMode(0);
c->SetFrameFillStyle(3003);
c->SetFrameLineColor(5);
c->SetFrameLineWidth(2);
c->SetFrameBorderMode(0);
c->Draw();
hs->Add(h1);
hs->Add(h2);
hs->Add(h3);
hs->Add(h4);
hs->Draw("nostack");
//hs->Draw("L");
hs->GetXaxis()->CenterTitle(1);
hs->GetYaxis()->CenterTitle(1);
TLegend *legend = new TLegend(0.8, 0.85, 0.9, 0.9);
legend->AddEntry(h1, "2.03 MeV", "l");
legend->AddEntry(h2, "4.25 MeV", "l");
legend->AddEntry(h3, "6.1 MeV", "l");
legend->AddEntry(h4, "14.05 MeV", "l");
legend->Draw();
c->Modified();
c->Update();
}