emptyspace | R Documentation |
Try to find the largest empty rectangle on a plot.
emptyspace(x,y=NULL)
x,y |
x and y positions of the points on the plot. |
‘emptyspace’ searches the pairs of points on the plot to find the largest rectangular space within which none of the points lie. It does not guarantee that the space will be large enough to fit a legend or text.
Two alternatives are the ‘largest.empty’ function in the Hmisc package and the ‘maxEmptyRect’ function. While ‘maxEmptyRect’ will generally outperform ‘emptyspace’, ‘emptyspace’ will sometimes find a slightly smaller, but "squarer" rectangle.
The ‘x’ and ‘y’ coordinates of the center of the rectangle found.
Ray Brownrigg
x<-rnorm(100)
y<-rnorm(100)
plot(x,y,main="Find the empty space",xlab="X",ylab="Y")
es<-emptyspace(x,y)
# use a transparent background so that any overplotted points are shown
boxed.labels(es,labels="Here is the\nempty space",bg="transparent")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.