Re: [Matplotlib-users] rasterizing a figure

2009-11-12 Thread Geoffrey Ely
On Nov 12, 2009, at 4:32 PM, Jae-Joon Lee wrote: > shape = fig.canvas.get_width_height()[::-1] + (4,) > > im = np.frombuffer(fig.canvas.buffer_rgba(0,0), > dtype=np.uint8).reshape(shape) > > Using buffer_rgba is more efficient than using tostring_rgb as no > memory is allocated. B

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Eric Firing
Ryan Neve wrote: > Eric, > > Here's a pcolor plot of the same data: > contour_plot = pyplot.pcolor(x_grid,y_grid,z_grid_masked) > http://imgur.com/iL4k7.png It looks to me like this is more suitable for showing your data than contourf would be. > > For contourf I'm using: > contour_plot = > p

Re: [Matplotlib-users] rasterizing a figure

2009-11-12 Thread Jae-Joon Lee
On Thu, Nov 12, 2009 at 6:32 PM, Geoffrey Ely wrote: > Thanks for the help. With that I get: > > AttributeError: 'function' object has no attribute '__buffer__' > > shape = fig.canvas.get_width_height()[::-1] + (4,) im = np.frombuffer(fig.canvas.buffer_rgba(0,0), dtype=np.uint

[Matplotlib-users] Docked/tabbed figures in one window?

2009-11-12 Thread qubax
Good evening. I would like to be able to dock some figures into one window and be able to look at them by tabs or something similar. Is something like that already implemented or does someone know of a widget that can do that? If not ... do you have suggestions of how i could do that? Thanks fo

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Ryan Neve
Eric, Here's a pcolor plot of the same data: contour_plot = pyplot.pcolor(x_grid,y_grid,z_grid_masked) http://imgur.com/iL4k7.png For contourf I'm using: contour_plot = pyplot.contourf(x_grid,y_grid,z_grid_masked,contour_levels,origin='upper',\ extent=extent,cmap=pyplot.cm.jet) ... where the

Re: [Matplotlib-users] rasterizing a figure

2009-11-12 Thread Geoffrey Ely
On Nov 12, 2009, at 2:01 PM, Christopher Barker wrote: > Geoffrey Ely wrote: >> Hi, What is the best way to rasterize a figure into a numpy array for >> further image processing? > > untested, but I suspect: >> image = >> numpy.frombuffer( fig.canvas.renderer.buffer_rgba).reshape( shape ) Thanks

Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Robert Kern
On 2009-11-12 16:44 PM, Andrew Straw wrote: > Robert Kern wrote: >> On 2009-11-12 12:05 PM, Andrew Straw wrote: >> >>> Celil Rufat wrote: >>> I just installed matplotlib on Snow Leopard 10.6 with the Qt4 backend (via macports). However, when I try one of the Qt4 examles: python

Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Andrew Straw
Robert Kern wrote: > On 2009-11-12 12:05 PM, Andrew Straw wrote: > >> Celil Rufat wrote: >> >>> I just installed matplotlib on Snow Leopard 10.6 with the Qt4 backend >>> (via macports). However, when I try one of the Qt4 examles: >>> >>> python >>> /opt/local/share/py26-matplotlib/examples/

Re: [Matplotlib-users] mplot3d: bar3d + colormap somehow?

2009-11-12 Thread Gael Varoquaux
On Wed, Nov 04, 2009 at 08:56:49PM +0100, qu...@gmx.at wrote: > I would like to make a mplot3d.bar3d plot where the colour indicates > the value of the element. Like: negative values blue, positive red, > zero green. From what i see i can only give all bars the same > color ... Is there a way arou

Re: [Matplotlib-users] rasterizing a figure

2009-11-12 Thread Christopher Barker
Geoffrey Ely wrote: > Hi, What is the best way to rasterize a figure into a numpy array for > further image processing? untested, but I suspect: > image = numpy.frombuffer( fig.canvas.renderer.buffer_rgba).reshape( shape ) might work -- something like that, anyway. -CHB -- Christopher Bark

Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Robert Kern
On 2009-11-12 12:05 PM, Andrew Straw wrote: > Celil Rufat wrote: >> I just installed matplotlib on Snow Leopard 10.6 with the Qt4 backend >> (via macports). However, when I try one of the Qt4 examles: >> >> python >> /opt/local/share/py26-matplotlib/examples/user_interfaces/embedding_in_qt4.py >> >

[Matplotlib-users] problems finding the right Tcl/Tk to go with Python 2.6

2009-11-12 Thread Dan Klinglesmith
I have installed Python 2.6.4 and matplotlib-0.99.1 on my windows machine (XP). When trying to use Tkinter I get an error message that says it can not find the right version of Tcl. Where can I find the right binaries to load on my windows machine? cheers, Dan Daniel A. Klinglesmith III Mag

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Eric Firing
Geoffrey Ely wrote: > On Nov 12, 2009, at 10:03 AM, Eric Firing wrote: >> Geoffrey Ely wrote: >>> Ryan, >>> I have noticed the same issue with contourf. It seems to be a thin >>> gap between neighboring polygons showing through. You can turn on >>> a thin contour line of the same color to co

[Matplotlib-users] rasterizing a figure

2009-11-12 Thread Geoffrey Ely
Hi, What is the best way to rasterize a figure into a numpy array for further image processing? The code I have below works, but I am wondering if there is a more convenient way. Thanks in advance, Geoff import pylab, numpy fig = pylab.figure() pylab.plot( [1, 2, 1] ) dpi = fig.get_dpi() size

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Geoffrey Ely
On Nov 12, 2009, at 10:03 AM, Eric Firing wrote: > Geoffrey Ely wrote: >> Ryan, >> I have noticed the same issue with contourf. It seems to be a thin >> gap between neighboring polygons showing through. You can turn on >> a thin contour line of the same color to cover the gap: >> for c in py

Re: [Matplotlib-users] bug in set_yscale of bar graphs?

2009-11-12 Thread Jae-Joon Lee
On Thu, Nov 12, 2009 at 12:07 PM, per freem wrote: > ax.axis["xzero"].set_visible(True) > # make other axis (bottom, top, right) invisible. The ax.axis["xzero"] is drawn along the y=0 line. Therefore, if you use logscale, this axis become invisible. > invisible = ["bottom", "top", "right"] > for

[Matplotlib-users] close_event

2009-11-12 Thread Gregor Thalhammer
Hi all, I want to use matplotlib to plot in realtime the position of a microscope stage, read out over a serial connection. Essentially I reached my goal, starting from the example simple_idle_wx.py http://matplotlib.sourceforge.net/examples/animation/simple_idle_wx.html Now I have two questions

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Eric Firing
Ryan Neve wrote: > Thank you for the suggestion, but I couldn't see a difference with > "antialiased" either True or False. The lines between contour levels remain. > I tried a different colormap (spectral) but it had the same effect. I > tried more color levels (256) but the effect got worse. >

Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Andrew Straw
Celil Rufat wrote: > I just installed matplotlib on Snow Leopard 10.6 with the Qt4 backend > (via macports). However, when I try one of the Qt4 examles: > > python > /opt/local/share/py26-matplotlib/examples/user_interfaces/embedding_in_qt4.py > > > IOError: [Errno 4] Interrupted system call > >

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Eric Firing
Geoffrey Ely wrote: > Ryan, > > I have noticed the same issue with contourf. It seems to be a thin gap > between neighboring polygons showing through. You can turn on a thin > contour line of the same color to cover the gap: > > for c in pylab.contourf( x, y, z ).collections: > c.set_li

Re: [Matplotlib-users] matplotlib with Qt4 backend

2009-11-12 Thread Jouni K . Seppänen
Celil Rufat writes: > However, when I try one of the Qt4 examles: [...] > File > "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py", > line 303, in get_fontconfig_fonts > status, output = commands.getstatusoutput("fc-list fil

Re: [Matplotlib-users] matplotlib WX and Qt4Agg backends

2009-11-12 Thread Taro Sato
TheLonelyStar wrote: > > > /net/gorgonzola/storage/nhuesken/svn/ActiveLearning/SVM/ModelSelection/Ergebnisse/plot.pyc > in plot(filename, line_list, name_list, reference) > 6 for i in xrange(len(line_list)): > 7 > plt.plot(m[:,reference],m[:,line_list[i]],lab

Re: [Matplotlib-users] bug in set_yscale of bar graphs?

2009-11-12 Thread per freem
thanks to all for the replies. i am still having an issue with the log scale of these plots. i am trying to hide the top and right axes of the plot, since these should not be there when plotting a histogram or a line plot. i use the following code: import matplotlib matplotlib.use('PDF') import ma

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Geoffrey Ely
Ryan, I have noticed the same issue with contourf. It seems to be a thin gap between neighboring polygons showing through. You can turn on a thin contour line of the same color to cover the gap: for c in pylab.contourf( x, y, z ).collections: c.set_linewidth( 0.1 ) Not ideal, but it wo

Re: [Matplotlib-users] Unwanted lines between contourf() contour levels

2009-11-12 Thread Ryan Neve
Thank you for the suggestion, but I couldn't see a difference with "antialiased" either True or False. The lines between contour levels remain. I tried a different colormap (spectral) but it had the same effect. I tried more color levels (256) but the effect got worse. I can't find any example pic

Re: [Matplotlib-users] overriding Collections.get_transform weirdness

2009-11-12 Thread Tony S Yu
On Nov 12, 2009, at 8:16 AM, Michael Droettboom wrote: > Thanks for looking into this further. Can you file a bug with this > script that appears differently in the PDF/PS/SVG/Agg backends vs. > Mac OS X? Bug filed. Thanks for your response. -Tony > > Cheers, > Mike > > Tony S Yu wrote: >

Re: [Matplotlib-users] overriding Collections.get_transform weirdness

2009-11-12 Thread Michael Droettboom
Thanks for looking into this further. Can you file a bug with this script that appears differently in the PDF/PS/SVG/Agg backends vs. Mac OS X? Cheers, Mike Tony S Yu wrote: > > On Nov 11, 2009, at 1:33 PM, Michael Droettboom wrote: > >> Which older revision (or release) worked as you expected?