comp.lang.ada
 help / color / mirror / Atom feed
From: bdbryant@mail.utexas.edu (Bobby D. Bryant)
Subject: Re: 2d graph
Date: Sat, 25 Mar 2006 12:33:13 +0000 (UTC)
Date: 2006-03-25T12:33:13+00:00	[thread overview]
Message-ID: <e03da8$1iq$1@geraldo.cc.utexas.edu> (raw)
In-Reply-To: m2zmjgkzan.fsf@hugin.crs4.it

On Fri, 24 Mar 2006, Jacob Sparre Andersen <sparre@nbi.dk> 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



  reply	other threads:[~2006-03-25 12:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-23 11:34 2d graph Anders Wirzenius
2006-03-23 13:20 ` Dmitry A. Kazakov
2006-03-23 13:40   ` Anders Wirzenius
2006-03-23 14:04   ` Bobby D. Bryant
2006-03-24  7:03     ` Anders Wirzenius
2006-03-24  8:44       ` Jacob Sparre Andersen
2006-03-25 12:33         ` Bobby D. Bryant [this message]
2006-03-23 15:38 ` Jeffrey R. Carter
2006-03-23 17:23 ` Jacob Sparre Andersen
2006-03-23 17:33 ` Alex R. Mosteo
2006-03-23 17:57   ` tmoran
2006-03-24  7:21   ` Anders Wirzenius
2006-03-23 19:31 ` Gautier
2006-03-25  3:12 ` Gene
2006-04-10 22:19 ` Stefan Skoglund
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox