Hi,
I am trying to draw a MultiGraph with a set of data points and their average value/error as a color band. Right now I have the following code :
TCanvas *c1 = new TCanvas("c1", "Neutron lifetime", 700, 500);
c1->SetGrid();
TMultiGraph *mg = new TMultiGraph();
TGraphMultiErrors *gme = new TGraphMultiErrors("gme", "Neutron lifetime measurements", e, date_bottle, lifetime_bottle, 0, 0, stat_bottle, stat_bottle);
gme->AddYError(e, systm_bottle, systp_bottle);
gme->SetMarkerStyle(20);
gme->SetMarkerColor(kBlue);
gme->SetLineColor(kBlue);
gme->GetXaxis()->SetNdivisions(505);
gme->GetYaxis()->SetNdivisions(510);
//gme->Draw("AP; Z");
//gme->Fit("pol0");
TGraphErrors *bottle_band = new TGraphErrors(2, bottle_x, bottle_y, 0, sig_bottle_y);
bottle_band->SetFillColor(4);
bottle_band->SetFillStyle(3010);
mg->Add(gme);
mg->Add(bottle_band);
mg->Draw("AP; Z");
This code give me this result :
test.pdf (13.9 KB)
As you can see my points are showing as intended but the color band does not. When I write :
mg->Draw("AP; Z; a3");
I have the following image :
test2.pdf (13.8 KB)
which as you can see is not good at all… How can I solve that in order to have both my points and the color band ?
Best,
Marius