better axis command?

As you know, in MATLAB, axis([-inf inf 0 10]) means that the

    > range of x-axis is determined automatically while the range
    > of y-axis is set manually to the range from 0 to 10.

    > In current Matplotlib, it seems there is no support for that
    > kind of partial range setting. If so, how about adding a
    > little intelligence on the axis function, like

    >>>> axis([None, None, 0, 10]).

This is certainly easy enough - does matlab also support

    >> axis([-inf, 5, 0, 10]).

in which case on the lower xlim is set automatically and the upper
xlim is 5?

    > And, any specific reason there is no xlim or ylim function?

I didn't know matlab had them :frowning: I'll add them. In the meantime:

  ax.set_xlim((xmin, xmax))

or
  
  set(gca(), 'xlim', (xmin, xmax))

or

  set(ax, xlim=(xmin, xmax))

and so on ...

···

-- Daehyok Shin (Peter) Geography Department Univ. of North

    > Carolina-Chapel Hill

    > -------------------------------------------------------
    > SF.Net email is sponsored by Shop4tech.com-Lowest price on
    > Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic
    > DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free
    > Shipping and Free Gift.
    > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
    > _______________________________________________
    > Matplotlib-users mailing list
    > Matplotlib-users@lists.sourceforge.net
    > https://lists.sourceforge.net/lists/listinfo/matplotlib-users

From: John Hunter [mailto:jdhunter@…8…]
Sent: Thursday, August 12, 2004 AM 8:49
To: Shin
Cc: matplotlib-users
Subject: Re: [Matplotlib-users] better axis command?

This is certainly easy enough - does matlab also support

    >> axis([-inf, 5, 0, 10]).

in which case on the lower xlim is set automatically and the upper
xlim is 5?

Yes. In my opinion, Using None is better than inf
because inf should be imported seperately in numarray
(from numarray.ieeespecial import nan, inf).

I didn't know matlab had them :frowning: I'll add them. In the meantime:

The xlim and ylim are ones I frequently use to adjust axis ranges.
I am quite sure many users will like the addition.
Note that xlim and ylim change only one axis without touching other axes,
such as automatic scaling.
Glad to contribute something to Matplotlib. Thanks for your effort.

Daehyok Shin

···

-----Original Message-----