R ggplot geom_tile without fill color

ggplot2, r

Solution

I think you are after `alpha` parameter. Minimal example:

Create a plot with dummy data where you set `color` (for "boundary") and no `fill`:

p <- ggplot(pp(20)[sample(20*20, size=200), ], aes(x = x, y = y, color = z))

Add `geom_tile()` with `alpha` set to `zero`:

p <- geom_tile(alpha=0)

Add `theme_bw()` as transparent tiles look lame with a dark gray background :)

p + theme_bw() 

Problem

I am trying to add a geom_tile layer to a plot without the filled color (just the outline). Is there a way to get a transparent tile where only the boundary is visible? Thanks

Original source