|
From: Sebi35 <bob...@ho...> - 2008-01-24 15:25:56
|
Hi all, I've been working a lot with Qt and I often have to use plot functions. I've recently discovered the power of Gnuplot and I'd like to encapsulate gnuplot in a Qt widget. Is that possible? What is the best to do this? I have read all the docs of the gnuplot distribution, and I feel like if I code a "Qt" terminal, the widget will only be reachable through the gnuplot application. Is there anyway to use Gnuplot as a library? Cheers, Sebastien -- View this message in context: http://www.nabble.com/Porting-Gnuplot-to-Trolltech-Qt-tp15065854p15065854.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Ethan M. <merritt@u.washington.edu> - 2008-01-24 20:31:15
|
On Thursday 24 January 2008 07:26, Sebi35 wrote: > > I've been working a lot with Qt and I often have to use plot functions. I've > recently discovered the power of Gnuplot and I'd like to encapsulate gnuplot > in a Qt widget. There was some discussion of this a long while back, but it didn't seem to go anywhere. http://marc.info/?l=gnuplot-info-beta&m=109846928802054&w=2 > I have read all the docs of the gnuplot distribution, and I feel like if I > code a "Qt" terminal, the widget will only be reachable through the gnuplot > application. It is not clear exactly what you want to present to the user inside this widget. Are you proposing to develop a GUI that controls gnuplot? Or are you proposing a Qt-based output widget that contains the plots created by gnuplot? Both? Something else? > Is there anyway to use Gnuplot as a library? No. But IMHO this would not be a useful thing to do even if it were possible. It is better to control the complete gnuplot app through a pipe, possibly through multiple pipes to multiple instances of gnuplot. The plots output from gnuplot could then be directed to any of a variety of output modes, including display within a panel of your hypothetical Qt widget. The CVS version of gnuplot now has an example script .../demo/gpdemos.tcl that demonstrates doing something of this sort using Tcl/Tk widgets. You might want to look at that to get a feel for one possible model of control flow. -- Ethan A Merritt |
|
From: Allin C. <cot...@wf...> - 2008-01-25 02:36:59
|
On Thu, 24 Jan 2008, Sebi35 wrote: > I've been working a lot with Qt and I often have to use plot > functions. I've recently discovered the power of Gnuplot and I'd > like to encapsulate gnuplot in a Qt widget. Is that possible? > What is the best to do this? Presumably you could model a Qt terminal on the wxt terminal in current CVS gnuplot. Along similar lines, I'm tempted to try writing a GTK terminal that does not depend on the additional wxWidgets layer. > I have read all the docs of the gnuplot distribution, and I feel > like if I code a "Qt" terminal, the widget will only be > reachable through the gnuplot application. Is there anyway to > use Gnuplot as a library? As Ethan says, No. This possibility has been discussed in the past, but gnuplot is still dependent on a large number of global variables; it doesn't have the modularity that would be required of a plotting library. But gnuplot is fast and easily scripted. As a "third party" programmer, even if you're not using pipes you can, for example, get gnuplot to generate a PNG file then display that file inside a window created using the widget set of your choice, and arrange suitable feedback to gnuplot via your own menus. Allin Cottrell |
|
From: Sebi35 <bob...@ho...> - 2008-01-25 15:45:20
|
First, thank you both for your quick answers :) > It is not clear exactly what you want to present to the user inside > this widget. Are you proposing to develop a GUI that controls gnuplot? > Or are you proposing a Qt-based output widget that contains the > plots created by gnuplot? Both? Something else? Both in fact. For example, I'd like to develop a GUI to plot only simple sinus functions and I want the result to be in a Qt Widget. I think I'll look at the example script you were talking about Ethan. > But gnuplot is fast and easily scripted. As a "third party" > programmer, even if you're not using pipes you can, for example, > get gnuplot to generate a PNG file then display that file inside a > window created using the widget set of your choice, and arrange > suitable feedback to gnuplot via your own menus. Yes, could be a good idea to start with. I'll try all that and I let you know. Sebastien Allin Cottrell wrote: > > On Thu, 24 Jan 2008, Sebi35 wrote: > >> I've been working a lot with Qt and I often have to use plot >> functions. I've recently discovered the power of Gnuplot and I'd >> like to encapsulate gnuplot in a Qt widget. Is that possible? >> What is the best to do this? > > Presumably you could model a Qt terminal on the wxt terminal in > current CVS gnuplot. Along similar lines, I'm tempted to try > writing a GTK terminal that does not depend on the additional > wxWidgets layer. > >> I have read all the docs of the gnuplot distribution, and I feel >> like if I code a "Qt" terminal, the widget will only be >> reachable through the gnuplot application. Is there anyway to >> use Gnuplot as a library? > > As Ethan says, No. This possibility has been discussed in the > past, but gnuplot is still dependent on a large number of global > variables; it doesn't have the modularity that would be required > of a plotting library. > > But gnuplot is fast and easily scripted. As a "third party" > programmer, even if you're not using pipes you can, for example, > get gnuplot to generate a PNG file then display that file inside a > window created using the widget set of your choice, and arrange > suitable feedback to gnuplot via your own menus. > > Allin Cottrell > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > > -- View this message in context: http://www.nabble.com/Porting-Gnuplot-to-Trolltech-Qt-tp15065854p15090347.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |