Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## matplotlib-users

 [Matplotlib-users] xmax, etc. type commands From: Rick Muller - 2005-04-08 18:52:35 ```I find the following definitions really useful: def xmin(val): a = axis() a[0]=val axis(a) return def xmax(val): a = axis() a[1]=val axis(a) return def ymin(val): a = axis() a[2]=val axis(a) return def ymax(val): a = axis() a[3]=val axis(a) return I realize that part of the reason behind the pylab api is to mimic what is in matlab. But is there any reason why functions such as these couldn't be added? Rick Muller - rmuller@... - http://www.cs.sandia.gov/~rmuller Computational Materials and Molecular Biology Sandia National Laboratories PO Box 5800, M/S 1110 Albuquerque, NM 87185-1110 ```
 Re: [Matplotlib-users] xmax, etc. type commands From: John Hunter - 2005-04-08 19:03:28 ```>>>>> "Rick" == Rick Muller writes: Rick> I find the following definitions really useful: def Rick> xmin(val): a = axis() a[0]=val axis(a) return Rick> def xmax(val): a = axis() a[1]=val axis(a) return Rick> def ymin(val): a = axis() a[2]=val axis(a) return Rick> def ymax(val): a = axis() a[3]=val axis(a) return I'm not real keen on adding four new names to the pylab interface for such a small convenience. This has nothing to do with matlab compatibility, but just to try and limit the number of different functions that mostly do the same thing. Already we have axis, xlim, ylim, and ax.set_xlim, etc. Adding more different functions to set the limits is a recipe for complexity and confusion. I think there is a solution for you though by extending the functions already in place, which would entail just a little more typing. One possibility would be to allow kwargs to axis or xlim/ylim, so that you could do axis(xmin=2) and it would just update the xmin while keeping all other args the same. Alternatively, that interface could be expose in xlim/ylim xlim(xmin=2) What do you think? JDH ```