Have a set of point and a colored band in a MultiGraph

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

When you Add a graph to a multigraph you can specify the drawing option.

Thanks for your answer.
I have changed it to this :

mg->Add(bottle_band, "a3");
mg->Add(gme, "AP; Z");
mg->Draw();

But now the resulting graph is stuck between the y limit of the color band :
test3.pdf (13.3 KB)

How can I fix that ?

Okay I have it :sweat_smile:

mg->Add(bottle_band, "3");
mg->Add(gme, "P; Z");
mg->Draw("A");

Thanks !