Hello, I've added a new driver to the cairo family that lets you draw into a "external" cairo context (v8362). It is the same idea as Jonathan's extension to xcairo driver to allow the use of external XDrawables. Hopefully this will (also) be useful for integrating PLplot into larger GUI based applications that are handling their own windows.
Notes: (1) The cairoContext is currently not cleared by PLplot prior to plotting. (2) I don't think you can query the size of a cairo context, so in general you'd also need to tell PLplot the size of the graph that you wanted. -Hazen A trivial example: #include <stdio.h> #include <cairo.h> #include <cairo-ps.h> #include <plplot.h> int main(int argc, char *argv[]) { cairo_surface_t *cairoSurface; cairo_t *cairoContext; cairoSurface = cairo_ps_surface_create("test.ps", 720, 540); cairoContext = cairo_create(cairoSurface); plsdev("extcairo"); plinit(); pl_cmd(PLESC_DEVINIT, cairoContext); plenv(0.0, 1.0, 0.0, 1.0, 1, 0); pllab("x", "y", "title"); plend(); cairo_destroy(cairoContext); cairo_surface_destroy(cairoSurface); } Compile with: gcc ext-cairo-test.c -o ext-cairo-test `pkg-config --cflags --libs plplotd cairo` ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel