[R-sig-Geo] spplot, polygons, and line density fill

Hadley Wickham hadley at rice.edu
Mon Apr 25 20:27:26 CEST 2011

Hi Matthew,

The basic problem is that there is no low-level support for pattern
fills in grid. To resolve this, you need:

 * some way of parameterising pattern fills using other grobs.  A good
start would be to think about filling a region with regularly spaced
lines of different angles.

 * some way of clipping that filling pattern to arbitrary polygons
(not sure how hard that is to do)

 * some way of making it efficient, maybe using rasterGrob.

I haven't looked it into enough to know how hard or each each of these
steps would be.  You might try also asking on the ggplot2 mailing
list, because other's may have a better idea than me.


On Mon, Apr 25, 2011 at 11:38 AM, Matthew Landis <landis at isciences.com> wrote:
> Hi Hadley,
> Can you elaborate on what you mean by "not...easy"?  Does that mean
> "impossible", or  "not currently possible without writing a lot of low level
> code",  or something else?  Are there any resources you know that might help
> to implement it?
> Thanks,
> Matt
> On 4/25/2011 12:07 PM, Hadley Wickham wrote:
>> Unfortunately this type of fill is not currently easy with grid
>> graphics, which is what both spplot and ggplot2 use.
>> Hadley
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~
> Matthew Landis, Ph.D.
> Research Scientist
> ISciences, LLC
> 61 Main St. Suite 200
> Burlington VT 05401
> 802.864.2999
> ~~~~~~~~~~~~~~~~~~~~~~~~~~

Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

More information about the R-sig-Geo mailing list