## matplotlib-users

 [Matplotlib-users] Problem with set_xlim From: - 2007-01-04 16:20:20 ```Considering the following script I would Expect a resulting y range of (1, 2) but I get (1, 3). Is this a bug or a feature. I'm using python 2.5, matplotlib 0.87.7. from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure fig = Figure() canvas = FigureCanvas(fig) ax = fig.add_subplot(111) lines = (ax.plot([1, 2, 3], [1, 2, 3]),) axes = fig.get_axes()[0] axes.set_xlim((0, 2)) axes.set_aspect('auto', adjustable='box') axes.grid(True) canvas.print_figure('out.eps') Kind regards Berthold -- __ Address: G / \ L Germanischer Lloyd phone: +49-40-36149-7374 -+----+- Vorsetzen 35 P.O.Box 111606 fax : +49-40-36149-7320 \__/ D-20459 Hamburg D-20416 Hamburg ```
 Re: [Matplotlib-users] Problem with set_xlim From: Tommy Grav - 2007-01-04 16:45:27 ```You have to use set_ylim((0,2)) to set the y limits. Cheers Tommy On Jan 4, 2007, at 11:09 AM, Berthold H=F6llmann wrote: > Considering the following script I would Expect a resulting y range of > (1, 2) but I get (1, 3). Is this a bug or a feature. I'm using python > 2.5, matplotlib 0.87.7. > > from matplotlib.backends.backend_agg import FigureCanvasAgg as =20 > FigureCanvas > from matplotlib.figure import Figure > fig =3D Figure() > canvas =3D FigureCanvas(fig) > ax =3D fig.add_subplot(111) > lines =3D (ax.plot([1, 2, 3], [1, 2, 3]),) > axes =3D fig.get_axes()[0] > axes.set_xlim((0, 2)) > axes.set_aspect('auto', adjustable=3D'box') > axes.grid(True) > canvas.print_figure('out.eps') > > Kind regards > Berthold > --=20 > __ Address: > G / \ L Germanischer Lloyd > phone: +49-40-36149-7374 -+----+- Vorsetzen 35 P.O.Box 111606 > fax : +49-40-36149-7320 \__/ D-20459 Hamburg D-20416 Hamburg > > > ----------------------------------------------------------------------=20= > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to =20 > share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?=20 > page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ```
 Re: [Matplotlib-users] Problem with set_xlim From: - 2007-01-05 08:20:34 ```Tommy Grav writes: > You have to use set_ylim((0,2)) to set the y limits. Is there a function/method to calculate apropriate ?lim values from a given Dataset? Regards Berthold -- __ Address: G / \ L Germanischer Lloyd phone: +49-40-36149-7374 -+----+- Vorsetzen 35 P.O.Box 111606 fax : +49-40-36149-7320 \__/ D-20459 Hamburg D-20416 Hamburg ```