garretrc / ggvoronoi

Easy Voronoi diagram heatmaps with ggplot2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extend bounding box when using geom_voronoi

neuropil opened this issue · comments

commented

Great ggplot2 add-on package!

What is the easiest way to expand or modify the bounding area when calling geom_voronoi?

In the example below, I would like to expand the bounding box in both x and y dimensions.

df = data.frame(1:10,rnorm(10),rnorm(10))
colnames(df) = c('label','x','y')
ggplot(df) +
geom_voronoi(aes(x,y,fill=label))

Thanks!
John

commented

Got it! I needed to appropriately apply the 'outline' argument.

How did you apply it?

How did you apply it?

I think the provided vignette may be of help here (: Once the package is loaded, try the command: vignette('ggvoronoi'). You'll see the outline can be specified as a data frame with x and y coordinates where the first row matches the last