Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: standalone geom_mark #281

Open
adamkemberling opened this issue Sep 26, 2022 · 0 comments
Open

Feature request: standalone geom_mark #281

adamkemberling opened this issue Sep 26, 2022 · 0 comments
Labels
feature a feature request or enhancement

Comments

@adamkemberling
Copy link

Huge fan of the appearance and functionality behind the annotation style used in geom_mark_ellipse() and the other geoms that allow both a label and description, and would really like in some instances to be able to force where they appear, or use them without needing to reference datapoints you wish to mark.

This would be particularly helpful in cases when using multiple geom_mark_ellipse() lines to either highlight different subsets of data or when the data comes from different dataframes. Oftentimes these labels will overlay other data when employing filters and it would be good to have controls against that outside of building the descriptions into the dataframes themselves. Would also be helpful when standardizing placement for reproducible reporting.

Example use case highlighting the current implementation

library(ggplot2)
library(ggforce)

ggplot(mtcars, aes(x = wt, y = mpg, col = factor(cyl))) +
geom_point() +
ggforce::geom_mark_ellipse(aes(filter = cyl == 4,
label = cyl),
description = "4 Cyllinders are okay") +
ggforce::geom_mark_ellipse(aes(filter = cyl == 6,
label = cyl),
description = "6 Cyllinders are equally okay too")

image

Potential functionality

ggplot(mtcars, aes(x = wt, y = mpg, col = factor(cyl))) +
geom_point() +
ggforce::geom_mark_ellipse(aes(filter = cyl == 4,
label = cyl),
description = "4 Cyllinders are okay") +
ggforce::geom_mark_text(
con.x = 3.5,
con.y = 28,
label.x = 4,
label.y = 32,
label = "6"
description = "I want my 6 cyllinder label over here, I don't care where my plot window thinks it should go")

@thomasp85 thomasp85 added the feature a feature request or enhancement label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants