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.
    > Cheap Ink Cartridges: printer ink, printer cartridge, printer cartridges, inkjet cartridge, ink jet cartridges, ink cartridges, ink cartridge, inkjet cartridges, epson ink cartridge, epson ink cartridges
    > _______________________________________________
    > Matplotlib-users mailing list
    > Matplotlib-users@lists.sourceforge.net
    > matplotlib-users List Signup and Options

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-----