Re: 2d graph
- From: bdbryant@xxxxxxxxxxxxxxx (Bobby D. Bryant)
- Date: Sat, 25 Mar 2006 12:33:13 +0000 (UTC)
On Fri, 24 Mar 2006, Jacob Sparre Andersen <sparre@xxxxxx> wrote:
Anders Wirzenius wrote:
I wanted to query what Ada support there is for 2d line graphics.
My dad is using a GtkAda based library for 2D line graphics (actually
for proper plotting of data), but I don't know if the rendering is
done on the Ada level or in the Gtk code.
Thanks for the GnuPlot hint, seems easy to use. I can live with that
until I find an "Ada way".
I usually use Gnuplot for plotting data in LaTeX, PNG and Postscript
format, but maybe it's time to sit down and write an Ada library, so
the task can be better integrated in my other code.
GtkAda includes bindings for the GtkExtra plotting utilities that
someone wrote in C <http://gtkextra.sourceforge.net/>, originally for
the development of SciGraphica <http://scigraphica.sourceforge.net/>.
GtkExtra (including the GtkAda binding) supports both 2D and 3D plots,
plus canvases that let you drag stuff around on, and various other stuff,
and will let you spill your plot to a file as Postscript.
You can see an example of its use here (watch line wrap) -
<http://www.cs.utexas.edu/users/bdbryant/talk-origins/mutation-experiment/index.html>
The plots were displayed in a window and updated in real time as the
program ran. A button dumped it to a Postscript file as it appeared
at the time the button was clicked. (I converted the .eps to .png for
the web page.)
Many of the Gtk.Extra plotting procedures have a very large number of
parameters, so when I was using it I made wrappers for various types
of plots I commonly used. It might be useful if someone wrote a
higher-level package of wrappers for stuff everyone commonly uses.
If that's overkill, GtkAda also binds the ordinary GTK+ line drawing
routines, and you can dump them to a file as PNG or JPEG. An example
can be seen at -
<http://www.cs.utexas.edu/users/bdbryant/talk-origins/ga-on-tsp/index.html>
Notice that the images don't have anti-aliasing for the lines. There may
be a way to do that now, but I'm not sure.
The Postscript generated by the GtkExtra plotters does have
anti-aliasing, and produces stuff suitable for inclusion into
LaTeX documents.
I have a vague memory of seeing an Ada package that lets you talk
directly to GNUplot, though I'm not sure. You might google for it
if that strikes your fancy.
--
Bobby Bryant
Austin, Texas
.
- References:
- 2d graph
- From: Anders Wirzenius
- Re: 2d graph
- From: Dmitry A. Kazakov
- Re: 2d graph
- From: Bobby D. Bryant
- Re: 2d graph
- From: Anders Wirzenius
- Re: 2d graph
- From: Jacob Sparre Andersen
- 2d graph
- Prev by Date: Re: Ada to Interfacing C# (Urgent)
- Next by Date: Re: Request for critics
- Previous by thread: Re: 2d graph
- Next by thread: Re: 2d graph
- Index(es):