|
From: nabed <ss...@ol...> - 2009-03-25 12:31:37
|
Hi Would it be possible to add the ability recieve output from gnuplot, over stdout to enable command driven bi-directional communication with gnuplot. That way a program could start an embedded gnuplot process and monitor the processes input and outpout streams to do bi-directional communication. Specifically I would want to be able to use this text output pipe mechanism to: 1) get the region displayed by the graph, after the user has finished interactively zooming and panning. (get_xxx) 2) to be able to set when the user can interact with gnuplot or not i.e. toggle interaction mode. 3) to be able to be able to put gnuplot in a mode which allows the user to toggle the addition and removal of new data points and to output point_added and point_removed notifications. Thanks, Serle -- View this message in context: http://www.nabble.com/Enhancement-Request%3A-output-pipe-for-interogation-commands-tp22495484p22495484.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Ethan M. <merritt@u.washington.edu> - 2009-03-25 16:16:23
|
On Wednesday 25 March 2009 05:31:14 nabed wrote: > > Hi > > Would it be possible to add the ability recieve output from gnuplot, over > stdout to enable command driven bi-directional communication with gnuplot. > That way a program could start an embedded gnuplot process and monitor the > processes input and outpout streams to do bi-directional communication. > > Specifically I would want to be able to use this text output pipe mechanism > to: > > 1) get the region displayed by the graph, after the user has finished > interactively zooming and panning. (get_xxx) If you want output to stdout: print GPVAL_XMIN, GPVAL_XMAX, GPVAL_YMIN, GPVAL_YMAX If you want output via a new or different pipe: set print "| namedpipe" print GPVAL_XMIN, GPVAL_XMAX, GPVAL_YMIN, GPVAL_YMAX > 2) to be able to set when the user can interact with gnuplot or not i.e. > toggle interaction mode. I don't understand what you mean by this. > 3) to be able to be able to put gnuplot in a mode which allows the user to > toggle the addition and removal of new data points and to output point_added > and point_removed notifications. See the demo script: "mousevariables.dem" All of this is possible already; much of since version 4.2 or earlier. If you could narrow your question down to a specific thing that you want to do, perhaps someone will suggest a bit of sample code to look at. > Thanks, > Serle -- Ethan A Merritt |
|
From: nabed <ss...@ol...> - 2009-03-26 07:31:50
|
Thanks Ethan, The final part of the question is to provide the ability for the user to graphically add new points onto a given graph by clicking on a location on the graph. e.g say I have a smooth function and want to add a bump to it in a region, I could replace three existing points by adding three new points (via mouse interaction on the graph window) and then form a new smooth interpolated graph containing the new points. I would then want to get the new dataset back from gnuplot. Serle Ethan Merritt wrote: > > On Wednesday 25 March 2009 05:31:14 nabed wrote: >> >> Hi >> >> Would it be possible to add the ability recieve output from gnuplot, over >> stdout to enable command driven bi-directional communication with >> gnuplot. >> That way a program could start an embedded gnuplot process and monitor >> the >> processes input and outpout streams to do bi-directional communication. >> >> Specifically I would want to be able to use this text output pipe >> mechanism >> to: >> >> 1) get the region displayed by the graph, after the user has finished >> interactively zooming and panning. (get_xxx) > > If you want output to stdout: > print GPVAL_XMIN, GPVAL_XMAX, GPVAL_YMIN, GPVAL_YMAX > > If you want output via a new or different pipe: > set print "| namedpipe" > print GPVAL_XMIN, GPVAL_XMAX, GPVAL_YMIN, GPVAL_YMAX > >> 2) to be able to set when the user can interact with gnuplot or not i.e. >> toggle interaction mode. > > I don't understand what you mean by this. > >> 3) to be able to be able to put gnuplot in a mode which allows the user >> to >> toggle the addition and removal of new data points and to output >> point_added >> and point_removed notifications. > > See the demo script: "mousevariables.dem" > > > All of this is possible already; much of since version 4.2 or earlier. > If you could narrow your question down to a specific thing that you want > to do, perhaps someone will suggest a bit of sample code to look at. > >> Thanks, >> Serle > > -- > Ethan A Merritt > > ------------------------------------------------------------------------------ > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > > -- View this message in context: http://www.nabble.com/Enhancement-Request%3A-output-pipe-for-interogation-commands-tp22495484p22717065.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Ben A. <bpa...@ma...> - 2009-03-29 18:23:31
|
nabed wrote: > > Thanks Ethan, > > The final part of the question is to provide the ability for the user to > graphically add new points onto a given graph by clicking on a location on > the graph. e.g say I have a smooth function and want to add a bump to it > in a region, I could replace three existing points by adding three new > points (via mouse interaction on the graph window) and then form a new > smooth interpolated graph containing the new points. I would then want to > get the new dataset back from gnuplot. > > Serle > As Petr mentioned Octave is able to communicate with gnuplot and obtain information with regards the mouse. You might find it useful to look over that solution. http://hg.savannah.gnu.org/hgweb/octave/file/8651fcc89556/scripts/plot/__gnuplot_ginput__.m The pipe/plot-stream is opened in the routine below http://hg.savannah.gnu.org/hgweb/octave/file/8651fcc89556/scripts/plot/gnuplot_drawnow.m Ben -- View this message in context: http://www.nabble.com/Enhancement-Request%3A-output-pipe-for-interogation-commands-tp22495484p22770790.html Sent from the Gnuplot - Dev mailing list archive at Nabble.com. |
|
From: Petr M. <mi...@ph...> - 2009-03-26 07:58:36
|
> Would it be possible to add the ability recieve output from gnuplot, over > stdout to enable command driven bi-directional communication with gnuplot. > That way a program could start an embedded gnuplot process and monitor the > processes input and outpout streams to do bi-directional communication. This is possible and e.g. Octave is using this mechanism. For more information, see http://gnuplot.sourceforge.net/links.html => Programming interfaces – bidirectional interaction > Specifically I would want to be able to use this text output pipe mechanism > to: > > 1) get the region displayed by the graph, after the user has finished > interactively zooming and panning. (get_xxx) I would recommend to let the user do the zooming and press Enter when he is finished ... because then you can use pause mouse key until MOUSE_CHAR is Enter (or Escape) character. > 2) to be able to set when the user can interact with gnuplot or not i.e. > toggle interaction mode. {un}set mouse > 3) to be able to be able to put gnuplot in a mode which allows the user to > toggle the addition and removal of new data points and to output point_added > and point_removed notifications. That's not task of gnuplot but of the driving application. You can do pause mouse key and then read MOUSE_CHAR, MOUSE_X, MOUSE_Y (see "show var all"), remove/add the point, and replot. --- PM |