From: Philippe C. <phi...@gm...> - 2010-03-18 12:01:15
|
Hello, the following will display a figure with a plot. the figure will embed the classic toolbar. import matplotlib.pyplot as plt import numpy as np x=np.arange(0, 1, 0.1) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x) plt.show() from there, is it possible to add new buttons to the toolbar ? with new fonction ? or do I have to embed everythong in wxPython, GTK or others ? thank you, Philippe |
From: Gökhan S. <gok...@gm...> - 2010-03-18 20:26:40
|
On Thu, Mar 18, 2010 at 7:01 AM, Philippe Crave <phi...@gm...>wrote: > Hello, > > the following will display a figure with a plot. the figure will embed > the classic toolbar. > > import matplotlib.pyplot as plt > import numpy as np > x=np.arange(0, 1, 0.1) > fig = plt.figure() > ax = fig.add_subplot(111) > ax.plot(x) > plt.show() > > from there, is it possible to add new buttons to the toolbar ? with > new fonction ? > or do I have to embed everythong in wxPython, GTK or others ? > > thank you, > Philippe > Hi Pierre Raybaut a nice extension for what you are asking. You will need to use Qt4Agg backend to use it. The code is at http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/backends/qt4_editor/ He doesn't seem like planning to add more onto this extension ( http://code.google.com/p/spyderlib/issues/detail?id=136) This said, his code is easy to read and you should easily be able to extend it according to your need. -- Gökhan |
From: butterw <bu...@gm...> - 2010-03-20 23:06:44
|
Is there an minimal example file available showing how to activate this new plot toolbar ? changing the backend to Qt4Agg apparently is not sufficient. Gökhan SEVER-2 wrote: > > Hi Pierre Raybaut a nice extension for what you are asking. You will need > to > use Qt4Agg backend to use it. The code is at > http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/backends/qt4_editor/ > > He doesn't seem like planning to add more onto this extension ( > http://code.google.com/p/spyderlib/issues/detail?id=136) > > This said, his code is easy to read and you should easily be able to > extend > it according to your need. > > > -- > Gökhan > -- View this message in context: http://old.nabble.com/toolbar-tp27944614p27972619.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Gökhan S. <gok...@gm...> - 2010-03-20 23:17:57
|
On Sat, Mar 20, 2010 at 6:06 PM, butterw <bu...@gm...> wrote: > > Is there an minimal example file available showing how to activate this new > plot toolbar ? > > changing the backend to Qt4Agg apparently is not sufficient. > > You need to install matplotlib from the svn trunk. http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn -- Gökhan |
From: <bu...@gm...> - 2010-03-21 00:43:50
|
I'm using the recent '0.99.3rc1' which does include the qt4_editor code. Should the new toolbar just appear when you open a plot or is specific code needed to call it ? Le , Gökhan Sever <gok...@gm...> a écrit : > On Sat, Mar 20, 2010 at 6:06 PM, butterw bu...@gm...> wrote: > Is there an minimal example file available showing how to activate this > new > plot toolbar ? > changing the backend to Qt4Agg apparently is not sufficient. > You need to install matplotlib from the svn trunk. > http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn > -- > Gökhan |
From: Gökhan S. <gok...@gm...> - 2010-03-21 00:53:14
|
On Sat, Mar 20, 2010 at 7:43 PM, <bu...@gm...> wrote: > I'm using the recent '0.99.3rc1' which does include the qt4_editor code. > If you have the qt4_editor code within your installation you are good to go then. Just create a new plot while the Qt4Agg backend is pre-selected you should have an additional icon on the existing navigation toolbar. From there on you should see a window when you fire that icon. It is migrated from Pierre Raybout's spyderlib ( http://code.google.com/p/spyderlib/) > > Should the new toolbar just appear when you open a plot or is specific code > needed to call it ? > > > Le , Gökhan Sever <gok...@gm...> a écrit : > > > > > > > On Sat, Mar 20, 2010 at 6:06 PM, butterw bu...@gm...> wrote: > > > > > > > > Is there an minimal example file available showing how to activate this > new > > > > plot toolbar ? > > > > > > > > changing the backend to Qt4Agg apparently is not sufficient. > > > > > > > > > > > > You need to install matplotlib from the svn trunk. > > > > http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn > > > > > > -- > > Gökhan > -- Gökhan |
From: Peter B. <bu...@gm...> - 2010-03-21 03:22:14
|
Correction: '0.99.3rc1' does not include the qt4_editor code, so you do need to get the source files from svn. The feature is a nice addition to matplotlib.. On Sun, Mar 21, 2010 at 1:53 AM, Gökhan Sever <gok...@gm...> wrote: > > > On Sat, Mar 20, 2010 at 7:43 PM, <bu...@gm...> wrote: >> >> I'm using the recent '0.99.3rc1' which does include the qt4_editor code. > > > If you have the qt4_editor code within your installation you are good to go > then. Just create a new plot while the Qt4Agg backend is pre-selected you > should have an additional icon on the existing navigation toolbar. From > there on you should see a window when you fire that icon. > > It is migrated from Pierre Raybout's spyderlib > (http://code.google.com/p/spyderlib/) > > >> >> Should the new toolbar just appear when you open a plot or is specific >> code needed to call it ? >> >> >> Le , Gökhan Sever <gok...@gm...> a écrit : >> > >> > >> > On Sat, Mar 20, 2010 at 6:06 PM, butterw bu...@gm...> wrote: >> > >> > >> > >> > Is there an minimal example file available showing how to activate this >> > new >> > >> > plot toolbar ? >> > >> > >> > >> > changing the backend to Qt4Agg apparently is not sufficient. >> > >> > >> > >> > >> > >> > You need to install matplotlib from the svn trunk. >> > >> > http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn >> > >> > >> > -- >> > Gökhan > > > -- > Gökhan > |
From: Philippe C. <phi...@gm...> - 2010-03-21 07:16:29
|
without the svn version, you can save both files. edit figureoptions.py to modify the import: #import matplotlib.backends.qt4_editor.formlayout as formlayout import formlayout then, you can attach the nice dialog box to a Event, something like that works: import matplotlib.pyplot as plt import numpy as np import figureoptions t = np.arange(0, 1+0.01, 0.01) y = np.sin(2*np.pi*t) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(t, y, 'r-o') def onclick(event): figureoptions.figure_edit(ax) cid = fig.canvas.mpl_connect('button_press_event', onclick) plt.show() click on the figure, you will get the dialog box. less cool than the button, but not too bad. 2010/3/21 Peter Butterworth <bu...@gm...> > Correction: '0.99.3rc1' does not include the qt4_editor code, so you > do need to get the source files from svn. > > The feature is a nice addition to matplotlib.. > > > On Sun, Mar 21, 2010 at 1:53 AM, Gökhan Sever <gok...@gm...> > wrote: > > > > > > On Sat, Mar 20, 2010 at 7:43 PM, <bu...@gm...> wrote: > >> > >> I'm using the recent '0.99.3rc1' which does include the qt4_editor code. > > > > > > If you have the qt4_editor code within your installation you are good to > go > > then. Just create a new plot while the Qt4Agg backend is pre-selected you > > should have an additional icon on the existing navigation toolbar. From > > there on you should see a window when you fire that icon. > > > > It is migrated from Pierre Raybout's spyderlib > > (http://code.google.com/p/spyderlib/) > > > > > >> > >> Should the new toolbar just appear when you open a plot or is specific > >> code needed to call it ? > >> > >> > >> Le , Gökhan Sever <gok...@gm...> a écrit : > >> > > >> > > >> > On Sat, Mar 20, 2010 at 6:06 PM, butterw bu...@gm...> wrote: > >> > > >> > > >> > > >> > Is there an minimal example file available showing how to activate > this > >> > new > >> > > >> > plot toolbar ? > >> > > >> > > >> > > >> > changing the backend to Qt4Agg apparently is not sufficient. > >> > > >> > > >> > > >> > > >> > > >> > You need to install matplotlib from the svn trunk. > >> > > >> > http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn > >> > > >> > > >> > -- > >> > Gökhan > > > > > > -- > > Gökhan > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Peter B. <bu...@gm...> - 2010-03-28 12:12:51
|
I've done a few minor enhancements and corrections to the qt4_editor (interactive plot options popup). Should I submit them to matplotlib or directly to the original author Pierre Raybaut ? What plot options do you think can be added to the qt4_editor ? I've added a basic Legend option to the Axes tab and a Visible option to the Curves tab. formlayout.py: validate color strings (for matplotlib) figureoptions.py: corrected marker=='none' bug corrected matplotlib green in COLORS ('g': '#008000') missing ',' and incorrect naming of some MARKERS LINESTYLES are sorted. 'steps' removed from linestyles On Sun, Mar 21, 2010 at 5:22 AM, Peter Butterworth wrote: > Correction: '0.99.3rc1' does not include the qt4_editor code, so you > do need to get the source files from svn. > > The feature is a nice addition to matplotlib.. |