Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread John Pye
Hi John Your suggestions worked perfectly. Thanks! As an aside, I had been composing my image as a GTK Pixbuf object (via the gtk.gdk.pixbuf_new_from_data method: hacking about, poking values into a big array of char) and I did notice that the gtk.gdk.Pixbuf.get_pixels_array method didn't give me

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread Stefan van der Walt
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 trans

[Matplotlib-users] Newbie question plotting x y data

2006-06-15 Thread Hanno Klemm
I have a very silly question: I have data in the format x y data(x,y) and now I would like to plot a point with a color corresponding to data at position x,y (pretty much like with imshow). Unfortunately, the data does not always fill a rectangular grid, so that using imshow just as it is, does

[Matplotlib-users] Possible bug in axvline

2006-06-15 Thread Tony Mannucci
axvline does not appear to work correctly. It appears to change the plot axes. For example: import matplotlib import pylab as PLT >>> x array([ 0., 1., 2., 3.]) >>> y array([ 2., 3., 5., 6.]) >>> PLT.plot(x,y) [] >>> PLT.axis([0.0,3.0,0.0,5.0]) [0.0, 3.0, 0.0, 5.0] >>> PLT.axvline(1.5)

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread Fernando Perez
On 6/15/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > 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. > > ax.imshow(im

Re: [Matplotlib-users] Possible bug in axvline

2006-06-15 Thread John Hunter
> "Tony" == Tony Mannucci <[EMAIL PROTECTED]> writes: Tony> axvline does not appear to work correctly. It appears to Tony> change the plot axes. For example: Thanks for the bug-report and example code, this is now fixed in svn 2481. To fix this, I also added support for selective au

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread Stefan van der Walt
On Thu, Jun 15, 2006 at 11:02:47AM -0600, Fernando Perez wrote: > On 6/15/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > 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 elemen

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread Fernando Perez
On 6/15/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > That's exactly what I need -- except that it forces the creation of a > new figure, which doesn't play well with subplot. Specifying a figure > number is, like it says in the docstring, rather unpredictable. Is > there an easy way to w

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread Eric Firing
Fernando Perez wrote: > On 6/15/06, Stefan van der Walt <[EMAIL PROTECTED]> wrote: > > >>That's exactly what I need -- except that it forces the creation of a >>new figure, which doesn't play well with subplot. Specifying a figure >>number is, like it says in the docstring, rather unpredictable.

[Matplotlib-users] New Bug in legend with tex in 0.87.2

2006-06-15 Thread Samuel M. Smith
I recently upgraded to 0.87.2 with numpy 0.9.6 on Mac OSX 10.4.6. The first time I tried to generate a plot with a legend I got this error. This same code did not produce and error the last time I ran it with an earlier version. Is this fixed already in svn? --> 432legend(loc = 'lower r

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread John Hunter
> "Eric" == Eric Firing <[EMAIL PROTECTED]> writes: Eric> One can control the aspect ratio with Axes.set_aspect(), so Eric> making a new figure is not really necessary now. Fernando, if you haven't played with the new aspect handling courtesy of Mark Bakkar and Eric, you should give i

[Matplotlib-users] plotting an array of enumerated values

2006-06-15 Thread John Pye
Hi all I have some data with enumerated values in an array. Values are like 1,2,7,9 spread around in the array. I want to plot those values so that I can see the 'regions' in my data, then I want to overlay this with some contour lines drawn from other data. I want to be able to specify the color

Re: [Matplotlib-users] showing an image on log axes?

2006-06-15 Thread David Huard
Hi, 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.def logspace(start,stop,num=50,endpoint=True,base=10.0):    """Evenly spaced numbers on a logarithmic scale.     Computes int(num) evenly spaced exponen

[Matplotlib-users] latex labels on plots

2006-06-15 Thread John Pye
Hi all I came across this page: http://www.scipy.org/Cookbook/Matplotlib/UsingTex which mentions using LaTeX to generate labels on plots in Matplotlib. What I only discovered recently is that you don't need this 'usetext=1' thing in order to create captions on plots that include subscripts, etc.

Re: [Matplotlib-users] plotting an array of enumerated values

2006-06-15 Thread John Pye
By the way, I had some success with this, but my approach is really inefficient. Perhaps someone could suggest how I can improve the following: import matplotlib.numerix as nx from numarray import ma def enumimage(A,colors): """ Create an image from a matrix of enumerated values