Hi, I'm using matplotlib embedded in my wxpython application and needed to give users a quick way to relimit a figure, for example after removing a line from a plot. Therefore I added a button to the toolbar. Do you think it would make sense to include this in matplotlib by default? Appended you find modifications of backend_bases.py and backends/backend_wx.py as well as a draft for a symbol. Greetings, Dieter
On 09/27/2010 03:46 AM, Dieter Weber wrote: > Hi, > I'm using matplotlib embedded in my wxpython application and needed to > give users a quick way to relimit a figure, for example after removing a > line from a plot. Therefore I added a button to the toolbar. Do you > think it would make sense to include this in matplotlib by default? I don't think it would. The standard toolbar is for typical interactive use, where I don't think the relimit functionality is needed often enough to justify having its own button--if at all. Better to keep that toolbar simple. Eric > Appended you find modifications of backend_bases.py and > backends/backend_wx.py as well as a draft for a symbol. > > Greetings, > Dieter > > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > > > > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
On Mon, Sep 27, 2010 at 1:27 PM, Eric Firing <ef...@ha...> wrote: > On 09/27/2010 03:46 AM, Dieter Weber wrote: > > Hi, > > I'm using matplotlib embedded in my wxpython application and needed to > > give users a quick way to relimit a figure, for example after removing a > > line from a plot. Therefore I added a button to the toolbar. Do you > > think it would make sense to include this in matplotlib by default? > > I don't think it would. The standard toolbar is for typical interactive > use, where I don't think the relimit functionality is needed often > enough to justify having its own button--if at all. Better to keep that > toolbar simple. > > Eric > > Just playing devil's advocate here... Considering how we can now have multiple show() calls and with the upcoming ipython looking more and more spiffy, could there be a future use case for this toolbar button? On the other hand, how would the inclusion of this button impact users of other interactive scripts that have added their own buttons? I mean, planning for the future, can it be definitively said that matplotlib will never add anymore toolbar buttons? Could developers rely on that real estate not being taken over by rule of "eminent domain", if you will? Ben Root
On 09/27/2010 08:35 AM, Benjamin Root wrote: > On Mon, Sep 27, 2010 at 1:27 PM, Eric Firing <ef...@ha... > <mailto:ef...@ha...>> wrote: > > On 09/27/2010 03:46 AM, Dieter Weber wrote: > > Hi, > > I'm using matplotlib embedded in my wxpython application and > needed to > > give users a quick way to relimit a figure, for example after > removing a > > line from a plot. Therefore I added a button to the toolbar. Do you > > think it would make sense to include this in matplotlib by default? > > I don't think it would. The standard toolbar is for typical interactive > use, where I don't think the relimit functionality is needed often > enough to justify having its own button--if at all. Better to keep that > toolbar simple. > > Eric > > > Just playing devil's advocate here... > > Considering how we can now have multiple show() calls and with the > upcoming ipython looking more and more spiffy, could there be a future > use case for this toolbar button? > > On the other hand, how would the inclusion of this button impact users > of other interactive scripts that have added their own buttons? I mean, > planning for the future, can it be definitively said that matplotlib > will never add anymore toolbar buttons? Could developers rely on that > real estate not being taken over by rule of "eminent domain", if you will? > > Ben Root > Ben, I don't understand either of your questions. What's the point? Eric
On Mon, Sep 27, 2010 at 1:47 PM, Eric Firing <ef...@ha...> wrote: > On 09/27/2010 08:35 AM, Benjamin Root wrote: > > On Mon, Sep 27, 2010 at 1:27 PM, Eric Firing <ef...@ha... > > <mailto:ef...@ha...>> wrote: > > > > On 09/27/2010 03:46 AM, Dieter Weber wrote: > > > Hi, > > > I'm using matplotlib embedded in my wxpython application and > > needed to > > > give users a quick way to relimit a figure, for example after > > removing a > > > line from a plot. Therefore I added a button to the toolbar. Do > you > > > think it would make sense to include this in matplotlib by > default? > > > > I don't think it would. The standard toolbar is for typical > interactive > > use, where I don't think the relimit functionality is needed often > > enough to justify having its own button--if at all. Better to keep > that > > toolbar simple. > > > > Eric > > > > > > Just playing devil's advocate here... > > > > Considering how we can now have multiple show() calls and with the > > upcoming ipython looking more and more spiffy, could there be a future > > use case for this toolbar button? > > > > On the other hand, how would the inclusion of this button impact users > > of other interactive scripts that have added their own buttons? I mean, > > planning for the future, can it be definitively said that matplotlib > > will never add anymore toolbar buttons? Could developers rely on that > > real estate not being taken over by rule of "eminent domain", if you > will? > > > > Ben Root > > > > Ben, > > I don't understand either of your questions. What's the point? > > Eric > > First, I am asking if there are no use-cases for this button in the future with the advent of an improved ipython environment? In other words, more people may use matplotlib+ipython like a regular MATLAB environment. Could this button be a useful feature later? Second, irregardless of whether this button is included or not, there have been app developers who have added buttons to the toolbar for their own use. Can these developers count on that real estate to always be free? Can we definitively say that matplotlib will never have more buttons added to its default toolbar? Does that make more sense? Ben Root
On Mon, Sep 27, 2010 at 1:57 PM, Benjamin Root <ben...@ou...> wrote: > Second, irregardless of whether this button is included or not, there have > been app developers who have added buttons to the toolbar for their own > use. Can these developers count on that real estate to always be free? Can > we definitively say that matplotlib will never have more buttons added to > its default toolbar? On a different but related topic, I think it would definitely be desirable to support customizable toolbars, so users could easily add their own buttons, remove buttons, connect them to their own callbacks, etc... That would take a bit of work to handle this across GUIS and platforms with icon specifications, etc, but would certainly be useful. Adding one more button for a somewhat specialized use case is definitely not a good idea, as only a tiny faction of users actually modify data in objects in place. A related button to autoscale y after zoom based on current x limits would be somewhat handy in my own experience, but again, I'd rather have customizable toolbars with a stock functionality that we could add or remove as desired. JDH
On Mon, Sep 27, 2010 at 8:57 PM, Benjamin Root <ben...@ou...> wrote: > On Mon, Sep 27, 2010 at 1:47 PM, Eric Firing <ef...@ha...> wrote: > >> On 09/27/2010 08:35 AM, Benjamin Root wrote: >> > On Mon, Sep 27, 2010 at 1:27 PM, Eric Firing <ef...@ha... >> > <mailto:ef...@ha...>> wrote: >> > >> > On 09/27/2010 03:46 AM, Dieter Weber wrote: >> > > Hi, >> > > I'm using matplotlib embedded in my wxpython application and >> > needed to >> > > give users a quick way to relimit a figure, for example after >> > removing a >> > > line from a plot. Therefore I added a button to the toolbar. Do >> you >> > > think it would make sense to include this in matplotlib by >> default? >> > >> > I don't think it would. The standard toolbar is for typical >> interactive >> > use, where I don't think the relimit functionality is needed often >> > enough to justify having its own button--if at all. Better to keep >> that >> > toolbar simple. >> > >> > Eric >> > >> > >> > Just playing devil's advocate here... >> > >> > Considering how we can now have multiple show() calls and with the >> > upcoming ipython looking more and more spiffy, could there be a future >> > use case for this toolbar button? >> > >> > On the other hand, how would the inclusion of this button impact users >> > of other interactive scripts that have added their own buttons? I mean, >> > planning for the future, can it be definitively said that matplotlib >> > will never add anymore toolbar buttons? Could developers rely on that >> > real estate not being taken over by rule of "eminent domain", if you >> will? >> > >> > Ben Root >> > >> >> Ben, >> >> I don't understand either of your questions. What's the point? >> >> Eric >> >> > First, I am asking if there are no use-cases for this button in the future > with the advent of an improved ipython environment? In other words, more > people may use matplotlib+ipython like a regular MATLAB environment. Could > this button be a useful feature later? > > Second, irregardless of whether this button is included or not, there have > been app developers who have added buttons to the toolbar for their own > use. Can these developers count on that real estate to always be free? Can > we definitively say that matplotlib will never have more buttons added to > its default toolbar? > > Does that make more sense? > > A feature-set that MATLAB has and is missing from matplotlib is editing the plot via the GUI. You can actually remove lines from the plot without typing anything in the interpreter. I think it is via a line properties menu, but maybe you can also get there by right-clicking the line and choosing delete (can't recall, I'll have to check). If/when we add support for such things in mpl, the relimit button would become much more useful. Until we have that, I think JDH's idea for cross-GUI configurable toolbars is a better target to aim for. AA
a few comments: One possible limitation of the proposed relim code is that it doesn't take into account whether the lines are set visible or not. But otherwise it is a useful function for interactive use, which incidentally is the way I use matplotlib the most. Is there any reason why matplotlib doesn't have an optional additional menubar ? You could fit far more commands than in a toolbar. btw as demonstrated by the qt4_editor it is not difficult to implement a line properties dialog in matplotlib. A feature-set that MATLAB has and is missing from matplotlib is editing the plot via the GUI. You can actually remove lines from the plot without typing anything in the interpreter. I think it is via a line properties menu, but maybe you can also get there by right-clicking the line and choosing delete (can't recall, I'll have to check). If/when we add support for such things in mpl, the relimit button would become much more useful. Until we have that, I think JDH's idea for cross-GUI configurable toolbars is a better target to aim for. AA -- View this message in context: http://old.nabble.com/Toolbar-button-for-relimiting-tp29819182p29823872.html Sent from the matplotlib - devel mailing list archive at Nabble.com.
Am Montag, den 27.09.2010, 15:42 -0700 schrieb butterw: > a few comments: > > One possible limitation of the proposed relim code is that it doesn't take > into account whether the lines are set visible or not. But otherwise it is > a useful function for interactive use, which incidentally is the way I use > matplotlib the most. > > Is there any reason why matplotlib doesn't have an optional additional > menubar ? You could fit far more commands than in a toolbar. > > btw as demonstrated by the qt4_editor it is not difficult to implement a > line properties dialog in matplotlib. > > > A feature-set that MATLAB has and is missing from matplotlib is editing the > plot via the GUI. You can actually remove lines from the plot without typing > anything in the interpreter. I think it is via a line properties menu, but > maybe you can also get there by right-clicking the line and choosing delete > (can't recall, I'll have to check). > If/when we add support for such things in mpl, the relimit button would > become much more useful. > > Until we have that, I think JDH's idea for cross-GUI configurable toolbars > is a better target to aim for. > > AA Here are my reasons to add the button, just to add to the discussion: I've written two applications so far that embed matplotlib, and in both I felt that the relimit button was missing: In one, there are always lines added and removed and I often need to reset the plot limits, and in the second one I do in fact change the line's data so that I want to relimit occasionally. For that last application it is also important that the zoom level remains the same, unless I really want to change it, therefore the button and no automatic relimiting when lines are removed or data are changed. In both applications the toolbar is most useful for navigation in the plots, so please don't forget the people who embed matplotlib when you design the toolbar... :-) A menu would be great, it could for example be used in cases where the toolbar would be out of place. For embedding, it would not be so important to have a cross-platform interface for customization: After all, you're stuck with one toolkit anyway... As far as I can tell about wxpython, it is no problem to add anything to the toolbar afterwards. Maybe one could implement a "feature bitmap" in the constructor to turn specific buttons on or off. I'm just wondering if there are use cases for customization during interactive use, where it should definitely be cross-platform. Greetings, Dieter
> Here are my reasons to add the button, just to add to the discussion: > I've written two applications so far that embed matplotlib, and in both > I felt that the relimit button was missing: In one, there are always > lines added and removed and I often need to reset the plot limits, and > in the second one I do in fact change the line's data so that I want to > relimit occasionally. For that last application it is also important > that the zoom level remains the same, unless I really want to change it, > therefore the button and no automatic relimiting when lines are removed > or data are changed. In both applications the toolbar is most useful for > navigation in the plots, so please don't forget the people who embed > matplotlib when you design the toolbar... :-) If you are embedding mpl, it is easy to design a custom toolbar. Eg, see http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx4.html JDH