Numpy has a logspace function, so it may be a bad idea to create a function
in pylab with the same name that does something slightly different.
"""Evenly spaced numbers on a logarithmic scale.
Computes int(num) evenly spaced exponents from start to stop.
If endpoint=3DTrue, then last exponent is stop.
y =3D linspace(start,stop,num=3Dnum,endpoint=3Dendpoint)
2006/6/15, Stefan van der Walt <stefan@...>:
> On Tue, Jun 13, 2006 at 06:21:22AM -0500, John Hunter wrote:
> > setting the xscale and yscale to 'log' should work fine, as long as
> > you make sure the xaxis and yaxis do not contain nonpositive limits.
> > For an MxN image, the default limits are 0..N-1 and 0..M-1 and the 0
> > will break the log transform. You can work around this by setting the
> > image "extent"
> > from pylab import figure, show, nx
> > fig =3D figure()
> > ax =3D fig.add_subplot(111)
> > im =3D nx.mlab.rand(500,500)
> > ax.imshow(im, extent=3D(1,501,1,501))
> I often want to plot matrices, with the axes labeled according to the
> matrix index. I.e. the top-lefthand element should be (0,0) and the
> bottom-righthand element (rows,columns). Setting the extent does
> work, i.e.
> If others also use this frequently, it may be useful to have a quick
> way of doing it (or maybe, there already is, and I've missed it).
> Matplotlib-users mailing list