Re: [Matplotlib-users] backend with edition capabilities
Dear Andrea, All On 1 March 2012 22:31, Andrea Gavana andrea.gav...@gmail.com wrote: I thought the OP's original question was something like the Matlab plot editor (or whatever is its name), which allows you to edit line colours, styles, gridlines styles, this kind of stuff on a live plot (mind you, it's been 6 years since I used Matlab for the last time and I may have forgotten what the plot editor does). Anyway, if I am not completely off-track, this is something I had been looking for as well in matplotlib a while back (3, 4 years ago), but at that time I was told it would have been complicated to implement it for all the live backend (I can't recall the exact reason). I would say that, at least for the backends based on wxPython, this kind of modify-the-live-plot-via-GUI-interaction should be relatively straightforward, at least for the GUI part and for the basics (line styles, colours, markers and so on). However I am not sure what are the implications on the core matplotlib code. But if I have misunderstood, I apologize for the noise :-) . For the wx backend to matplotlib, wxmplot (http://github.com/newville/wxmplot, http://newville.github.com/wxmplot/) does provide some of the basic editing features for simple 2d line plots such as changing colour, style, markers, text labels and so on via a GUI form, much as you describe. For image displays, it allows changing the colour table, smoothing, and rotating and so on. It is definitely not as complete as all of matplotlib, and I'm sure it could be improved. Still, it can serve many simple plotting needs where one wants to give the end-user the ability to customize the plots, and wx/matplotlib developers needing might find it useful. --Matt Newville -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Nasty mouse event problem with wxPython
Hi Stefan, I've hit a problem when using the button_press_event to pop up a wx.MessageBox. After the messagebox is loaded the mouse becomes completely unresponsive (even outside the application) until the application is shut down (by using ALT+F4). I'm making a feature where the user, after right clicking on the figure (after doing some manipulations etc), are requested to answer a question in a message box. This problem seems only to occur on Linux.. Am I doing something wrong or is this a bug? I've attached the source that demonstrates the problem. Oddly, I saw very similar behavior recently (I didn't see the attachment...). What I found was that the canvas was still responsive, but that it stole the mouse from any other window (wx widgets or system widgets) and that this happened on Linux but not Windows. I believe that adding self.ReleaseMouse() at the end of the event handler will alleviate this problem. It might be best to do (assuming you bound mouse events with the Canvas.mpl_connect() ) to do evt.guiEvent.Skip() if self.HasCapture(): self.ReleaseMouse() I haven't fully explored this problem myself, but I am no longer experiencing it... Cheers, --Matt Newville newville at cars.uchicago.edu -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] figure in wxpython
Rein, I don't think you need to change the wx backend to make a MPL plot appear in a dockable pane.You can definitely create a wx.Panel and put a MPL Figure in it such as (untested code): untested code snippet import wx import matplotlib from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.figure import Figure class MyPlotPanel(wx.Panel): def __init__(self, parent, **kw): wx.Panel.__init__(self, parent, -1, **kw) self.fig = Figure(self,(6.0,4.0), dpi=96) self.axes = self.fig.add_axes([0.15,0.15,0.75,0.75]) self.canvas = FigureCanvasWxAgg(self,-1, self.fig) /untested code snippet and then use self.axes.plot() (or other methods) and canvas.draw(). Of course, you'll have to put that Panel someplace. I haven't tried to make a plot in a dockable window myself, but I'd be surprised if you couldn't do it. Take a look at wxmpl http://agni.phys.iit.edu/~kmcivor/wxmpl/ and/or my own PlotPanel code from MPlot: http://cars9.uchicago.edu/~newville/Python/MPlot/ and/or read http://www.scipy.org/Cookbook/Matplotlib/EmbeddingInWx for more hints and examples. Cheers, --Matt Newville - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] SVG vs PNG
All I want is to: a) Insert all of the plots I create with MPL onto a Word document. If you're fortunate enough to be using the wx backend, there is a Copy_to_Clipboard() method which works great: In a wx App, Ctrl-C can easily be bound to copy the figure to the clipboard, then paste it into apps such as Word.I tend to find better results from saving a higher-resolution PNG and inserting that into documents, but this copy-and-paste works great for quick prints (whereas printing directly from a wxApp seems to be very fragile and change with every wxPython release) I think pylab may not give you access to the Copy_to_Clipboard() method. --Matt Newville - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users