Hi Luca,
I have tried to reproduce your problem with the ntuple in hsimple.root
(see ROOTSYS/tutorials). For me it works fine. My macro is:
void tree() {
TCanvas *c1 = new TCanvas("c1","Tree test");
c1->SetLogy();
TH2F *frame = new TH2F("frame","", 100, -3, 3, 100, 0.01, 3);
frame->Draw();
TFile f("hsimple.root");
ntuple->Draw("py:px","py>0.1 && px>-3 && px <-1","same");
}
Cheers, Olivier
On Thu, 16 Dec 2004, Luca Grandi wrote:
> Dear all,
>
> I found a strange behavior using tree Draw on a specific frame.
>
> When i plot a tree without a predefined frame and i change the Y axis scale
> from linear to log the range is fixed by root and several points of the plot
> are excluded. For this reason I have followed a suggestion to create a
> predefined frame to fix the logarithmic range for the Y axis.
> I am using the following example
>
> TCanvas *c7 = new TCanvas("c7","Lifetime",+0,+0,900,680);
> c7->SetLogy();
> TH2F frame7("frame","Lifetime", 1, 0, 60, 1000, 1, 1000);
> frame7.Draw();
>
> Now with the treeviewer I plot on the frame a first plot with
>
> tv_tree->Draw("br.var1:br.var2","several cuts","same");
>
> At this point everything is OK.
>
> When I want to add another plot (with a similar command) on the same frame
> but with different cuts it creates a strange plot where the points are
> placed in a way different from what they look like when I plot them
> singularly. In other words the points are placed in a strange way and
> filling some region of the plot that are wrong (I know this since when I
> plot the second plot as first I found a regular behavior).
> Suggestions?
>
> Regards
>
> Luca
>
>
>
--
Org: CERN - European Laboratory for Particle Physics.
Mail: 1211 Geneve 23 - Switzerland Mailbox: J25910
E-Mail: Olivier.Couet@cern.ch Phone: +41 22 7676522
WWW: http://cern.ch/Olivier.Couet/ Fax: +41 22 7677155
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET