Re: TLine in LogX

From: Stanislav Nesterov <Stanislav.Nesterov_at_pnpi.spb.ru>
Date: Wed, 26 Jan 2005 19:58:41 +0300


Hi Thomas,

If you would like to draw line above the histogram, then all should work just fine (without correction of coors). But in your case you are trying to draw above gPad. And there is kind of bug I think which was introduced in attempt to remove this correction. Not very long time ago one needed to write:

         TLine l;
         l.DrawLine(TMath::Log10(x1),y1,TMath::Log10(x2),y2);

to draw lines over "log"ed histograms. Now you don't have to. In my version 4.00/06 drawing lines over histograms fine without Logarithms.

                                                                         
      Best regards,
                                                                         
                     Stanislav.

Thomas Bretz wrote:

> Hi,
>
> thanks for the hints, but I don't have to toggle between lin- and
> log-scale. I simple want to display a straight line on top of a
> log-scale histogram. For me it is not clear why this should not work.
> I would have no problem, to convert the coordinates manually before -
> but I couldn't fugure out how...
>
> Thomas.
>
> Olivier Couet wrote:
>
>> This one helps too:
>>
>> http://root.cern.ch/root/roottalk/roottalk02/0492.html
>>
>> O.
>>
>> On Tue, 25 Jan 2005, Thomas Bretz wrote:
>>
>>
>>> Dear all,
>>>
>>> what is wrong with this?
>>>
>>> new TCanvas
>>> gPad->Range(1,1,10,10);
>>> gPad->SetLogx();
>>>
>>> TLine l;
>>> l.DrawLine(2,2,9,9); // doesn't work
>>> l.DrawLine(0.1, 0.1, 0.9, 0.9) // doesn't work, too
>>>
>>> I'm not able to get a line drawn in a Logx-pad...
>>>
>>> Thomas.
>>>
>>>
>>
>>
Received on Wed Jan 26 2005 - 17:58:50 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET