From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,bf1120cc5ca0ddec X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newspump.sol.net!uwm.edu!newsfeed.cs.utexas.edu!geraldo.cc.utexas.edu!not-for-mail From: bdbryant@mail.utexas.edu (Bobby D. Bryant) Newsgroups: comp.lang.ada Subject: Re: 2d graph Date: Sat, 25 Mar 2006 12:33:13 +0000 (UTC) Organization: dis- Message-ID: References: <4cdpulq5589q.gj93rlx0sbam.dlg@40tude.net> Reply-To: bdbryant@mail.utexas.edu NNTP-Posting-Host: dial-a-128-83-253-118.telesys.its.utexas.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: geraldo.cc.utexas.edu 1143289993 1626 128.83.253.118 (25 Mar 2006 12:33:13 GMT) X-Complaints-To: abuse@utexas.edu NNTP-Posting-Date: Sat, 25 Mar 2006 12:33:13 +0000 (UTC) X-Newsreader: knews 1.0b.1 Xref: g2news1.google.com comp.lang.ada:3600 Date: 2006-03-25T12:33:13+00:00 List-Id: On Fri, 24 Mar 2006, Jacob Sparre Andersen 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 , originally for the development of SciGraphica . 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) - 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 - 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