Please provide the following information:

ROOT Version (e.g. 6.12/02): 6.12/04

Platform, compiler (e.g. CentOS 7.3, gcc6.2): CENTOS 7

Hello I would like to plot differences between two graphs that have drawn with TGraph.

Is there any way to do this? I tried by adding “Add(fluka_lead,-1)” but it is not working

Just to be understood, I attach the code. Be warned it is bit messy because of different binning between two difference sets of data

```
Float_t E1box1, E2box1 , Ybox1, EYbox1;
Double_t EnergyBox1[459];
Double_t eEnergyBox1[459];
Double_t FluenceBox1[459];
Double_t eFluenceBox1[459];
// per primary
double Norm = 1.0;
double sum=0;
double esum=0;
ifstream infile("fluka_lead.data");
double emin=0;
double emax=0;
for (int i=0; i<458; i++){
infile >> E1box1 >> E2box1 >> Ybox1 >> EYbox1;
// printf("%g\n",E1box1/E2box1);
if(!i) emin = E1box1;
if(i==457) emax = E2box1;
EnergyBox1[i] = (E2box1+E1box1)/2;
eEnergyBox1[i] = 0;
FluenceBox1[i] = Norm*Ybox1*(E2box1-E1box1)/(log(E2box1)-log(E1box1));
eFluenceBox1[i] = Norm*0.01*EYbox1*Ybox1*(E2box1-E1box1);
sum+=Ybox1*(E2box1-E1box1);
}
infile.close();
printf("sum = %g\n",sum);
TGraphErrors* fluka_lead = new TGraphErrors(458,EnergyBox1,FluenceBox1,eEnergyBox1,eFluenceBox1);
fluka_lead->SetMarkerSize(0.8);
fluka_lead->SetMarkerColor(kRed);
fluka_lead->SetMarkerStyle(20);
fluka_lead->SetLineColor(kRed);
fluka_lead->Draw("PLZ");
// printf("%g, %g\n",EnergyBox1[0],EnergyBox1[356]);
TGraph *geant_lead = new TGraph();
TH1F *h1 = new TH1F("f","G4 results",458,log(emin),log(emax));
ifstream file1("lead_geant4.txt");
int i=0;
double x1;
int nlines = 0;
while(!file1.eof()) {
nlines++;
file1>>x1;
h1->Fill(log(x1*1e-3));}
double integral = nlines/20000.;
sum=0;
double deltalog = (log(emax)-log(emin))/458.;
for(int i=0;i<458;++i) {
double elow = exp(log(emin)+deltalog*i);
double ehigh = exp(log(emin)+deltalog*(i+1));
sum += h1->GetBinContent(i)*(log(ehigh)-log(elow));
// printf("%g %g\n",x,h1->GetBinContent(i));
}
printf("sum=%g\n",sum);
for(int i=0;i<458;++i) {
double x = exp(h1->GetBinCenter(i));
double elow = exp(log(emin)+deltalog*i);
double ehigh = exp(log(emin)+deltalog*(i+1));
geant_lead->SetPoint(i,x,h1->GetBinContent(i)*integral/sum);
}
geant_lead->SetMarkerColor(kBlue);
geant_lead->SetMarkerStyle(21);
geant_lead->SetLineColor(kBlue);
geant_lead->SetMarkerSize(0.8);
geant_lead->Draw("PLZ");
h1->SetMaximum(100);
h1->SetMinimum(1e-9);
TCanvas *c2 = new TCanvas();
c2->SetLogy();
h1->Draw();
TCanvas *c3 = new TCanvas();
geant_lead->Add(fluka_lead,-1)
```