From: Joel VanderWerf Date: 2010-01-30T04:37:44+09:00 Subject: Re: bless roger's gnuplot as official? bwv549 wrote: > 1. Get mouse interactions working using this workaround: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/293549 The good news is that gnuplot version 4.3 solves this problem by letting you bind to the close event. (Before 4.3, using xwindows, you either have to use -persist, which doesn't support mouse, or you have to have a another process polling for WM_STATE=withdrawn using xprop.) Here[1] is a version of my gnuplot lib that has the appropriate workarounds for each version of gnuplot up thru the 4.4 beta. (It also uses the version to choose the terminal type.) It should be fairly easy to at least get the 4.3 code out of that, even if you don't want to bother with support for older versions. Briefly, the code is this: On xwindows, fork a gnuplot and send it these commands: set mouse bind allwindows Close 'exit gnuplot' # your plotting commands here then the parent just does: Process.wait This gnuplot lib is not really a competitor to either of the two gems. It doesn't try to wrap up the plot configuration commands in any kind of object oriented interface. (I prefer to use the string interface rather than objects, because it is so familiar and compact.) [1] http://path.berkeley.edu/~vjoel/vis/plot.tgz