I'm trying to graph an error region

This seems like a pretty basic question, but I’m very new at this and I can’t find a solution (or at least I haven’t yet).

I’m trying to graph some overlapping regions that are each constructed out of a set of data points along with their errors. (So I get a curve from the data points, and the errors give the curve some width. Something like a ribbon shape, only the errors are not constant so the ribbon has varying width.)

Something that’s sorta roughly in the same style as this plot (kinda):

physics.weber.edu/palen/Phsx1040 … aplot3.jpg

I was hoping that I could find a function that could do something like this. Does anyone have any suggestions for me?

try this example:

void omega() { TCanvas *c1 = new TCanvas("c1","c1",800,800); //draw the frame TH2F *frame = new TH2F("frame",";#Omega_{m};#Omega_{#Lambda}",2,0,2.5,2,0,2.5); frame->GetXaxis()->CenterTitle(); frame->GetYaxis()->CenterTitle(); frame->SetStats(0); frame->Draw(); //draw the graphs double xopen[5] = {0.19,0.5,0.5,0.19,0.19}; double yopen[5] = {0,0,2.5,2.5,0}; TGraph *gopen = new TGraph(5,xopen,yopen); gopen->SetFillColor(kGreen); gopen->SetFillStyle(3001); gopen->Draw("f"); gopen->Draw("l"); double xnova[10] = {0,0.50,1.0,1.3,1.5,1.5,1.45,1.3,1.0,0.0}; double ynova[10] = {0,0.57,1.1,1.7,2.2,2.3,2.30,2.2,2.0,0.7}; TGraph *gnova = new TGraph(10,xnova,ynova); gnova->SetFillColor(kYellow); gnova->SetFillStyle(3001); gnova->Draw("f"); gnova->Draw("l"); double xflat[6] = {0,0.81,1.22,0.55,0.1,0}; double yflat[6] = {1,0,0,0.6,1,1}; TGraph *gflat = new TGraph(6,xflat,yflat); gflat->SetFillColor(kCyan); gflat->SetFillStyle(3001); gflat->Draw("f"); gflat->Draw("l"); }

see also $ROOTSYS/tutorials/graphics/graphShade.C


Thank you. Should have said so earlier, but that helped a lot.