Problems drawing TLine

Hi all,

I have a problem again, which is probably easily solvable. I’m trying to draw TLines, which refuse to show up.

		TCanvas* C=new TCanvas("canvas");
		C->SetLogx();
		C->SetLogy();
		C->cd();
		pad1 = new TPad();
		pad1->DrawFrame(1e-9,1,1000,1);
		TLine l(0.5,1,10000,1);
		l.Draw();

I do get the Frame and the warning :[quote] Warning in TPad::DrawFrame: Must be called for the current pad only [/quote]. No lines whatsoever. What am I doing wrong, it is probably something insignificant. When drawing lines directly from the terminal, it however does draw lines.

Yes … you could have noticed that your Y axis goes from 1 to 1 … :frowning:

try:

{
   TCanvas* C=new TCanvas("canvas");
   C->SetLogx();
   C->SetLogy();
   C->DrawFrame(1e-9,0.5,1000,1.5);
   TLine l(0.5,1,10000,1);
   l.Draw();
}

Yeah, that was not so smart. #-o Funny thing was that root still showed the pad I wanted,despite having the y-axis wrong.

Yes, ROOT has a special option: “Read in user’s mind” :wink:

1 Like

[quote=“couet”]Yes, ROOT has a special option: “Read in user’s mind” :wink:[/quote] And unfortunately this is the [color=#8000BF]d[/color][color=#808040]e[/color][color=#FF0040]f[/color][color=#40FF80]a[/color][color=#800040]u[/color][color=#0040FF]l[/color][color=#BF8040]t[/color] option. :mrgreen:

Yes,… but some people like it. :unamused: