Overplotting TGraphs, only one TGraph is plotted

Hi.

I followed the example in http://root.cern.ch/root/html/tutorials/graphs/gerrors2.C.html to plot 3 TGraphs, however only gEdgeEff is drawn.
What did I miss?
version : root_v5-34-00-patches

Double_t edgeEfficiency(float massenAbsorbCoff) {
	Double_t eff;
	float deadZone=0.02;//cm
	eff = TMath::Exp(-1*(deadZone/massenAbsorbCoff));
	return eff;
}

Double_t absorptionEff(float stipLenth, float massenAbsorbCoff) {
	Double_t eff;	
	eff = 1- (TMath::Exp(-1*(stipLenth/massenAbsorbCoff))) ;
	return eff;
}

int SensorEff () {
	int FAIL = -1;
	int OK = 0;
	int nlines = 5;
	float energy, attCoeff, massenAbsorbCoff;
	Double_t edgeEff;
	Double_t effStrip15;
	Double_t effStrip20;
	
	char *fabsorb = "someFile.txt";

	FILE *fp = fopen(fabsorb, "r");
	if(fp == NULL) {
		printf("Could not open file %s\n", fabsorb);
		return FAIL;
	}
	
	TCanvas *c1 = new TCanvas("c1","",200,10,700,500);
	// draw a frame to define the range
        TH1F *hr = c1->DrawFrame(5.,0.,45.,1.05);	
	TGraph *gEdgeEff = new TGraph ();
	gEdgeEff->SetLineColor(2);
	gEdgeEff->SetLineWidth(7); 
 	
 	TGraph *gstrip15 = new TGraph();
	gstrip15->SetLineColor(kBlue);
	gstrip15-> SetLineWidth(6);
             
	
	TGraph *gstrip20 =  new TGraph();
	gstrip20->SetLineColor(6); //magenta
	gstrip20-> SetLineWidth(3);
	
	
	for (int iline = 0; iline <nlines; iline++) {
		fscanf(fp, "%f %f %f\n",  &energy, &attCoeff, &massenAbsorbCoff);			
		
		edgeEff = edgeEfficiency (massenAbsorbCoff);	
		gEdgeEff->SetPoint(iline, energy*1000,edgeEff);
	
		effStrip15 = absorptionEff(1.5, massenAbsorbCoff);		
		gstrip15->SetPoint(iline, energy, effStrip15);
		
		effStrip20 = absorptionEff(2.0, massenAbsorbCoff);		
		gstrip20->SetPoint(iline, energy, effStrip20);		
	}
	gEdgeEff->Draw("C*");
	gstrip15->Draw("C*");
	gstrip20->Draw("C* ");
	
	fclose(fp);
	return OK;
}

Thanks

gEdgeEff->SetPoint(iline, energy1000, edgeEff); // “x” = energy1000
gstrip15->SetPoint(iline, energy, effStrip15); // “x” = energy (1000 times smaller than “gEdgeEff”)
gstrip20->SetPoint(iline, energy, effStrip20); // “x” = energy (1000 times smaller than “gEdgeEff”)

Also, make sure that the “y” values, “edgeEff”, “effStrip15”, “effStrip20”, are not too much different.

Note that all “x” and “y” values should be inside of your “frame axes ranges”:
TH1F *hr = c1->DrawFrame(5., 0., 45., 1.05); // xmin = 5, ymin = 0, xmax = 45, ymax = 1.05

yes, the values are very much with in range (see below) and “x” = energy*1000 noted. Is there something wrong or did i miss something in the sequence of the code? :unamused:

version : root_v5-34-00-patches

Energy 10.000000 edgeEff 0.999392
Energy 10.000000 effStrip15 0.044582
Energy 10.000000 effStrip20 0.058997

Energy 15.000000 edgeEff 0.997960
Energy 15.000000 effStrip15 0.142003
Energy 15.000000 effStrip20 0.184706

Energy 20.000000 edgeEff 0.995105
Energy 20.000000 effStrip15 0.307888
Energy 20.000000 effStrip20 0.387788

Energy 29.999999 edgeEff 0.982965
Energy 29.999999 effStrip15 0.724360
Energy 29.999999 effStrip20 0.820614

Energy 39.999999 edgeEff 0.959039
Energy 39.999999 effStrip15 0.956577
Energy 39.999999 effStrip20 0.984737


was able to solve this problem via another way of plotting, ie , TMultigraphs.Thanks!