Hi Michael,
you are obviously talking about the axis of a TGraph.
Instead of:
gr->GetYaxis()->SetLimits(0.0,3.0);
you should do:
gr->SetMinimum(0);
gr->SetMaximum(3);
Cheers
Otto
Michael Kosta Mitrovski wrote:
> Dear Rooters,
>
> I have a simple question. I am using TPad and I am trying to set the
> Limit at the x-axis and that works. If I am trying to do it at the y-
> axis it doesn't work. Here the part of my Macro :
>
> TCanvas *c = new TCanvas("c","",900,700);
> c->cd();
> c->SetFrameBorderMode(0);
>
> TPad *pad = new TPad("pad","",0.05,0.02,0.55,0.98,0);
> pad->Draw();
> pad->cd();
>
> pad->SetLeftMargin(0.2);
> pad->SetRightMargin(0.0);
> pad->SetBottomMargin(0.15);
> pad->SetTopMargin(0.1);
>
> gr->GetXaxis()->SetLimits(-3.0,3.0);
> gr->GetYaxis()->SetLimits(0.0,3.0);
> gr->Draw("AP");
>
> Thanks for the help.
>
> Best regrads,
>
> Michi
>
>
-- Dr. Otto Schaile Department f"ur Physik, LMU M"unchen Phone: +49 89 289 14070 Am Coulombwall 1, D-85748 Garching, Germany Mobil: +49 160 1553598 FAX: +49 89 289 14072 EMail: Otto.Schaile_at_Physik.Uni-Muenchen.DEReceived on Thu Oct 20 2005 - 09:07:16 MEST
This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:13 MET