Hi,
I’ve released Ruby/TkGnuplot.
By reason of damage of my eye, I take rest from works on Ruby
and reduce the time for using computers except for my primary work.
But I need the library for my primary work.
From README file,
···
===============================================================
Ruby/TkGnuplot is a library to plot graphs of Gnuplot on canvas
widgets. The plotting source of the graphs are outputs of 'tkcanvas’
device which is supported by Gnuplot 3.6+. On tkgnuplot.rb, to display
Gnuplot graphs, TkGnuplotCanvas class is defined as a subclass of
TkCanvas. When the widget size is changed, it can redraw the graphs
automatically.
To use Gnuplot, Ruby/TkGnuplot generates gnuplot processes and control
it by inter-process communication with PIPEs. This method is based on
the idea of Gordon Miller’s Ruby/Gnuplot. But the way of implementation
is different, because of inconvenience for Tk-interface.
One object of GnuplotProcess class, which is defined on gnuplot.rb,
corresponds to one Gnuplot process. Please see the demo script on tail
of gnuplot.rb to learn definition of plot data and so on.
By a GnuplotProcess object, you can do raw control of the Gnuplot. But
it is annoying to treat multiple graphs at same time. For example,
when you use multiple windows (distinguished by the terminal number)
on X, if multiple thread create graphs depend on same Gnuplot process,
Gnuplot may create wrong graphs. On xgnuplot.rb, X_Gnuplot class is
defined to avoid this problem and treat multiple plotting windows.
Please compare a demo on gnuplot.rb and a demo on xgnuplot.rb (They do
almost the same plotting).
If you want to treat multiple graphs on Tk, it is a problem that the
procedure name to draw a graph which generated by Gnuplot is fixed to
’gnuplot’. tkgnuplot.rb avoids the problem by shutting each procedure
in a namespace .
The demo script of tkgnuplot.rb shows same graphs of the demos of
gnuplot.rb and xgnuplot.rb. But if your Ruby/Tk is not impremented new
version of event-loop, the event-loop is dead-locked and redraw of the
graphs is stopped. If you have same problem on your application, you
may avoid the problem by newest version of Ruby/Tk.
Current version of Ruby/TkGnuplot has minimum set of methods for
practical use. And it is not enough. Your patches are welcome.
I’ve registered it on RAA.
If you are interested in it, please get from RAA.
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)