|
From: Allin C. <cot...@wf...> - 2009-09-08 13:04:34
|
On Tue, 8 Sep 2009, Richard Henwood wrote: > On Mon, 2009-09-07 at 17:49 -0400, Allin Cottrell wrote: > > On Mon, 7 Sep 2009, Ethan Merritt wrote: > > > > > On Monday 07 September 2009, Richard Henwood wrote: > > > > Hi All, > > > > > > > > I've been using Cairo (cairographics.org) a fair bit recently. I have > > > > not found a plotting library which is as mature as gnuplot. > > > > > > > > I understand that the wxWidgets terminal uses cairo. > > > > > > > > Has anyone considered the possibility of exposing the cairo context from > > > > within gnuplot/wxWidgets to the outside world? > > > > > > The development version has two new drivers - pngcairo and pdfcairo, > > > the use the cairo library. Not sure if that's what you meant. > > > Both drivers will be in the version 4.4 release candidate, which I > > > hope we can put out soonish. > > > > I think what Richard was asking is whether the "cairo drawing > > context" struct, or "cairo_t", that is used internally by gnuplot > > could somehow be exposed programmatically. But I don't see how > > this could be done -- seems to me it would require building > > gnuplot as a library, not a stand-alone executable. > > > > This is indeed what I am curious about. As you comment: if the > 'cairo drawing context' was exposed, it would then allow gnuplot > to behave as a library. i.e. if one was writing a cairo widget > for a (typically GTK) application, one may create a context > (cairo_t), pass it to gnuplot (along with some commands to plot > a graph on it), and then return it to the application for > display. I agree this would be very nice, but I'd put the conditionality the other way round: if it were possible to build gnuplot as a library, then it would be feasible to expose the relevant cairo_t via a suitable API. There are many programs that use gnuplot in "slave" mode and having a "libgnuplot" would be very useful in that context. But so far as I know (Ethan can correct me if I'm wrong) this is not on an active TODO list. However, gnuplot's GPVAL* variables, which provide a means of accessing internal data in text form, can be quite helpful if your program functions as a "driver" of gnuplot. Allin Cottrell |