Are they drawn correctly when plotted in 2 different pads?
-----Original Message-----
From: Mohammed Mahmoud Mohammed
Sent: Friday, November 19, 2010 11:20 AM
To: Olivier Couet; roottalk_at_root.cern.ch
Subject: RE: [ROOT] ProfileX for two Plots
Hi,
I accessed correctly to 2 histograms.
The 2 Histogram have the same range for X, these are the same histogram with different conditions.
Cheers
Mohammed
-----Original Message-----
From: Olivier Couet
Sent: Fri 11/19/2010 12:10 PM
To: Mohammed Mahmoud Mohammed; roottalk_at_root.cern.ch
Subject: RE: [ROOT] ProfileX for two Plots
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:37:18 CET
This archive was generated by hypermail 2.2.0 : Fri Nov 19 2010 - 17:50:01 CET