Hello,
I would need to create a very simple visualisation for some scientific
work I am doing. Basically I need to draw points in a 2D graph (and
specify which colours to use) and each time the user presses the
spacebar it should move to the next iteration and show (say with a
line) where everyone is.
What would be the simplest way to go about this?
The first priority is simplicity followed by easy to learn. I don’t
need either a powerful system nor something that looks pretty (I am
the only one who’ll use it ^_^).
Hello,
I would need to create a very simple visualisation for some scientific
work I am doing. Basically I need to draw points in a 2D graph (and
specify which colours to use) and each time the user presses the
spacebar it should move to the next iteration and show (say with a
line) where everyone is.
What would be the simplest way to go about this?
Any GUI tool with the word “canvas” in it, such as TkCanvas.
It’ll probably help to use an existing graphing package, as this will
take care of some of the tricky things for you such as scaling of axis
limits and plot styles.
Perhaps Gnuplot would work? Depending on which OS you are using it can
be easy to set up and use from Ruby, but you will have to become a
little familiar with Gnuplot to be able to control some things. I wrote
about using Gnuplot with Ruby recently: Fitting curves to data using Ruby and the GNU Scientific Library – Chris Lowis
The documentation is not really existent, though. You have to look into
the
(numerous) example files that come with the package, and look up the
corresponding functions in the Perl interface doc http://www.libming.net/docs/perl/index.html.
I just downloaded and installed it and want to use it to learn both Ruby
and
Flash.
Any GUI tool with the word “canvas” in it, such as TkCanvas.
TkCanvas is pretty good for 2D animations. I’ve used it in engineering
tools (including as a plug-in block for a simulink-based tool for a car
company).
I developed a general tool called tkar that runs as a standalone
process:
It’s based on ruby/tk, but you can feed it data from anywhere, not just
ruby code. It accepts data from pipes and sockets. Your controlling
process can decide when to send data, so you would probably handle
spacebar events on the upstream end of the socket.
It handles basic user interaction fairly well, allowing pan, zoom,
click, drag-n-drop (the latter two send the commands back out the
socket, so you can control the effects).
This simulink plugin is quite nice–beats the native simulink 2D
animation, and is just about as flexible as the simulink plotter block.
But probably not of interest on this list.
Any GUI tool with the word “canvas” in it, such as TkCanvas.
TkCanvas is pretty good for 2D animations.
On second thought…
Writing ruby/tk code directly (rather than over a socket as I suggested)
is probably a better idea for an animation that’s this simple.
tkar is especially good if you want to define some complex shapes and
then move them about, rotate them, change their shape params, etc.
using ruby/tk directly may be better if you have a grid of colored
squares and just want to change each square’s color over time. Probably
there’s even an example you could adapt.