From octave-graphics-request at bevo dot che dot wisc dot edu Fri Mar 12 05:28:39 1999 Subject: Canvas vs Plot Widget From: Rafael Laboissiere To: octave-graphics at bevo dot che dot wisc dot edu Date: 12 Mar 1999 12:28:37 +0100 I had thought about the Plot Widget implementation, as well as the necessity of a canvas widget. I will try to reply to some posts in this mailing list regarding these issues. >>>>> "JK" == Jonathan King writes: JK> Another very desirable thing if you want to do interactive plots JK> and "handle" like graphics is a good Canvas widget. Tk has one; JK> gtk might have one if you roll gnome into the mix, and I'm not JK> sure about wxWindows. The Tk canvas widget is great because you JK> can embed almost anything in it from images to text to menubars, JK> and, for better or for worse, it's easy to see how you could JK> implement satanic handle graphics for it. If I understand correctly, having a canvas widget would enable us to easier emulate some aspects of Handle Graphics, like the association of callbacks to mouse actions on plot objects (lines, axis, whatever). I have written some programs in Matlab that exploit this, but they all suck. User-written mouse interaction in Matlab is a way too slow. Furthermore, from the point of view of programming, the combination of the interpreted language + set/get constructs is just evil (some would say satanic ;-) My idea was to create a simple Plot Widget that contains essentially a pixmap. This is to answer JWE's question: >>>>> "JWE" == John W Eaton writes: JWE> I think it would be nice if we had a widget that could be used as JWE> part of the GUI toolkit we choose. Then the graphics widget could JWE> be used as part of the GUI too. Perhaps some existing graphics JWE> library (the GNU one, or plplot, or gnuplot) could be adapted? According to the design that I have in mind, a plotting library would be used to tell to the Plot Widget where to put the pixels that correspond to axes, ticks, labels, lines, points, etc. This widget would have some basic functionalities like scrolling and zooming (and eventually saving the plot as a PostScript file), but not much more than that. I really do not see how to completely emulate handle graphics in this framework, as it will not be possible to associate a bunch of pixels in the pixmap with a specific graphical objects (at least if we are going to use PLplot as the plotting engine). Of course, this widget could be packed in a window widget, along with other widgets like menus, buttons and the like. Do you guys think that this design is too constraining? I am trying to implement these ideas with PLplot and Gtk, just as a proof of concept. I will be extremely busy until the end of March and it will be hard to generate any useful code till there. As soon as I have something decent, I will post here. -- Rafael Laboissiere Institut de la Communication Parlee | Email: rafael at icp dot inpg dot fr UPRESS A CNRS 5009 / INPG | Voice: +33 4.76.57.48.49 46, av. Felix Viallet | Fax: +33 4.76.57.47.10 F-38031 Grenoble CEDEX 1 France | URL: http://www.icp.inpg.fr/~rafael