Plotting that way, will plot p1 on top of p.
If the range of p1 (on x and y) has no common parts with the range of p, you will not see p1.
To see if you can access correctly the 2 histograms plot them in 2 different pads:
TCanvas *c = new TCanvas c("c","c",800,400);
c->Divide(1,2);
c->cd(1); p->Draw();
c->cd(2); p1->Draw();
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
On Behalf Of Mohammed Mahmoud Mohammed
Sent: Friday, November 19, 2010 10:30 AM
To: roottalk_at_root.cern.ch
Subject: [ROOT] ProfileX for two Plots
Dear ROOTers,
I have a problem.
I tried to plot two 2-D plots in the same plot after making ProfileX,
But I got the plot for one plot only, I do not know what is the wrong.
TFile *f1 = new TFile("HLTMinBias_5_11.root"); TFile *f2 = new TFile("HLTPTM_5_11.root");
f1->cd ("demo"); TH2D
*myHist=(TH2D*)gDirectory->Get("kaonpionloop1");
TProfile *p=myHist->ProfileX(); p->SetMarkerColor(kBlue); p->Draw(); f2->cd ("demo"); TH2D
*myHist1=(TH2D*)gDirectory->Get("kaonpionloop1");
TProfile *p1=myHist1->ProfileX(); p1->SetMarkerColor(kRed); p1->Draw("same");
PLease, can you tell me what is my error?
Thanks in advance
Mohammed Received on Fri Nov 19 2010 - 11:10:45 CET
This archive was generated by hypermail 2.2.0 : Fri Nov 19 2010 - 17:50:01 CET