[R] changing the drawing context using Cairo and RGtk2

Mark Heckmann mark.heckmann at gmx.de
Mon Mar 5 22:14:36 CET 2012

I am not too familiar with Cairo and RGtk2 and have the following problem:
I have a container with two GTK drawing areas converted into Cairo devices. 
I know that I can set the current drawing context e.g. using dev.set().
But this is tedious. How can I set the context using the objects da1 or da2?

 w <- gtkWindow()
 w$setSizeRequest(400, 400)
 vbox <- gtkVBox()
 da1 <- gtkDrawingArea()   
 da2 <- gtkDrawingArea() 
 dummy <- asCairoDevice(da1) 
 dummy <- asCairoDevice(da2)
 par(oma=c(0,0,0,0), mar=c(0,0,0,0)) 

Mark Heckmann
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com

More information about the R-help mailing list