Need to make band in the plot

Hi,

I am trying to plot the some variable, q vs Energy. i want to make the band for this plot. But unable to make. What i could manage to get is the plot “sample plot” but it is not solving my issue . I am attaching the program , data file & sample plot.

Thanks in advance

opaltsallis.cc (290 Bytes)
fnbd.cc (512 Bytes)

Hi,

all the information you need can be found here: https://root.cern.ch/doc/master/classTGraphPainter.html#GP03a

You need also to sort your points according to the x coordinate. Here you can find a new version of your material where I also removed the unnecessary lines and added the ones needed for the “blue filling” you display in the image attached.

I hope it helps.

Cheers,
D

void fnbd1() {
  auto mycanvas = new TCanvas();
  auto g1 = new TGraphErrors("opaltsallis.dat");
  g1->SetLineColor(2);
  g1->SetFillColor(4);
  g1->SetFillStyle(3010);
  g1->Draw("AL3");
}

opaltsallis.dat

91      1.751 00 0.325
130.1	1.786 00 0.846
133	1.405 00 0.562
136.1	1.712 00 0.831
161	1.340 00 0.093
172	1.097 00 0.075
172.3	1.0001 00 0.0005
182.8	1.0001 00 0.0001
183	1.056 00 0.023
188.6	1.001 00 0.0006
189	1.099 00 0.096
194.4	1.812 00 0.585
200.2	1.405 00 0.060
206.2	1.967 00 0.041

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.