Hi, I'm a newbie to matplotlib. I'm embedding matplotlib (0,98.5.3) in a pyqt application. I'm using the qt4 backend and its navigation toolbar. I wish to execute a certain function every time the view interval of a figure is changed interactively (i.e. using the zoom rectangle or the axes pan/zoom button of the navigation toolbar). I'm interested in changes due to axes zoom and rectangle zoom but not in changes due axes pan. The only way I know for detecting this changes is 'x/ylim_changed' events. Unfortunately I don't know how to distinguish if the event is caused by a rectangle zoom, an axes zoom or an axes pan. I've read the events section of the documentation and searched the archives for a solution with no luck. Could somebody help me to solve this problem? Thanks in advance. Vicent PS: -- Share what you know, learn what you don't.
Hi Matthias, 2009年9月3日 Matthias Michler <Mat...@gm...>: > Hi Vicent, > > I think the following example may help you, althogh their might be a better > way: > thanks for your answer. It really helps. I didn't know about the mode attribute of navigation toolbars. Inspecting the NavigationToolbar2QTAgg class interactively with an IPython shell doesn't show such attribute for this class. Maybe it is created dynamically when the pan/zoom button is clicked? Now I still have to find out how to distinguish axes pan from axes zoom cases. I suppose I can use 'button_press_event' canvas events and use the button attribute of these events for knowing if the user is doing a pan or a zoom: pan/zoom mode + left button --> user is panning axes, pan/zoom mode + right button --> user is zooming axes. Right? Anyway, thanks again for your help. -- Share what you know, learn what you don't.
Hi Matthias , thanks a lot for your explanations. They were very useful. Vicent -- Share what you know, learn what you don't.
Dear Vicent, I'm struggling with embedding a navigation toolbar in a QT4 application with matplotlib canvas. Could you please send me an example code of how I add the navigation toolbar in the first place? As you notice, I'm a real newbe! Thank you very much, Thom Vicent Mas-2 wrote: > > Hi Matthias , > > thanks a lot for your explanations. They were very useful. > > Vicent > > -- > Share what you know, learn what you don't. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/pan-zoom-axes-problem-tp25274703p26127910.html Sent from the matplotlib - users mailing list archive at Nabble.com.
> Dear Vicent, > > I'm struggling with embedding a navigation toolbar in a QT4 application > with matplotlib canvas. Could you please send me an example code of how I > add the navigation toolbar in the first place? > > As you notice, I'm a real newbe! > > Thank you very much, > > Thom > > Vicent Mas-2 wrote: > > Hi Matthias , > > > > thanks a lot for your explanations. They were very useful. > > > > Vicent > Hi, you can start here (it is what I did :-): http://eli.thegreenplace.net/2009/05/23/more-pyqt-plotting-demos/ Hope it helps. Vicent :: Share what you know, learn what you don't