The simplest approach using just R is probably to create the background by plotting the grid of your images, then draw with your background color over everything outside the polygon that you want.
A possibly simpler approach is to draw the polygon in a solid color, then use an outside program such as Imagemagick or gimp2 to replace the polygon/color with your image. This post: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/109468.html may also give some ideas (similar question). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Alberto Monteiro > Sent: Monday, October 08, 2007 3:42 PM > To: r-help@r-project.org > Subject: [R] Fill a polygon with a pattern > > What is the simplest (namely: minimum number of libraries or > conflicts) way to fill a polygon with a pattern? > > For example, suppose I have (in a graphic file, like a jpeg) > the drawing of an "X". Then I fill a polygon (like a > triangle) with this pattern, and get something like: > > X > XXX > XXXXX > XXXXXXX > > (where the border "X"s could be truncated). > > I searched the rimage package, but it seems that there is no > such function. > > Alberto Monteiro > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.