RE: Re: Plotting library for GTK+



On Tue, 2 Dec 2014, Sergei Naumov wrote:


> I think this question was asked many times but googling gives a rather patchy > answer to it. So, I am writing a piece of C code that acquires some data from > hardware controllers and it also has to plot a few simple graphs and > histograms
> out of them. What is a "canonical" tool for such a purpose?
>
> I played a bit with GtkExtra but it seems that the project is somewhat > forgotten > and it does not have all the documentation in it. I also looked at Cairo but > it > is a low level library so I would have to implement all the scaling, axes, > ticks > and stuff myself. There are some interactive tools based on GTK but I need a
> library, as I have to build in plotting functionality.

AFAIK there's no such library, unfortunately. However gnuplot is perhaps the nearest thing to a "canonical" open-source plotting program. It can be run quite effectively in "slave" mode and can produce a wide variety of output formats (notably, using cairo and pango).

Gnuplot would be the best but it is an interactive program. It can also produce all kinds of file formats. Are you suggesting to create such files and display them in GTK application?

Yes, it's not the ideal solution (using a library would be cleaner) but it works quite nicely. You can generate a plot in batch mode using gnuplot's pngcairo "terminal" and load the PNG into a GTK window.

Allin Cottrell


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]