Re: SetRangeUser with TGraph

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Fri, 10 Mar 2006 21:05:57 +0100 (MET)


The simplest solution in your case is to do:

void test()
{

     TCanvas *c1 = new TCanvas;
     c1->DrawFrame(0,0,5,5);
     TGraph* graph = new TGraph();
     graph->SetPoint(0, 1, 1);
     graph->SetPoint(1, 2, 2);
     graph->Draw("pl");
     return;

}

Rene Brun

On Sat, 11 Mar 2006, OKUMURA,
Akira wrote:

> Dear Rene,
>
> I tried your macro, but
> graph->GetYaxis()->SetLimits(0, 5);
> was ignored.
> So I have to use the following combination.
> graph->GetXaxis()->SetRangeUser(0, 5);
> graph->GetYaxis()->SetLimits(0, 5);
>
> It looks strange for me.
>
> OKUMURA, Akira oxon_at_icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> Phone/Fax : +81 4-7136-3153
> Skype : okumura.akira
>
> On 2006/03/10, at 16:19, Rene Brun wrote:
>
>> void test()
>> {
>> TGraph* graph = new TGraph();
>> graph->SetPoint(0, 1, 1);
>> graph->SetPoint(1, 2, 2);
>> graph->GetXaxis()->SetLimits(0, 5);
>> graph->GetYaxis()->SetLimits(0, 5);
>> graph->Draw("apl");
>> return;
>> }
>>
>
Received on Fri Mar 10 2006 - 21:06:04 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:57 MET