Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upgeoms should be aware of the plotting area #7
Comments
|
Here's an example of the problem. Ideally, the labels would be free to move within the bounds of the entire plotting area. d <- subset(mtcars, wt > 3 & wt < 4)
ggplot() +
geom_point(
data = mtcars,
aes(wt, mpg), color = 'red'
) +
geom_text_repel(
data = d,
aes(wt, mpg, label = rownames(d)),
max.iter = 1e4
) +
theme_classic(base_size = 16) |

Issue #3 brought my attention to the fact that the ggrepel geoms are currently unaware of the available plotting area created by previous layers.
Instead, the ggrepel geoms assume that the plotting area is defined by the data provided to them. They should instead get the dimensions of the plotting area elsewhere, i.e. from the plot objects. I don't know how to implement this right now.