-
Notifications
You must be signed in to change notification settings - Fork 107
Feature request: geom_mark_polygon #333
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
Comments
Update: I've resolved the additional questions: library(ggplot2)
library(ggforce)
library(data.table)
load(gzfile("border_example.rda.gz"))
ggplot(data, aes(x=UMAP_1, y=UMAP_2)) +
geom_point(color="grey") +
geom_shape(data=maskTable, aes(group=group, color=cluster),
linewidth=1, fill=NA, expand=unit(-1, "pt")) +
geom_mark_hull(data=maskTable, fill = NA, color=NA, aes(group=cluster, label = cluster),
radius=0, expand=0, con.cap=0, con.type = "straight",
label.fontsize = 10, label.buffer = unit(0, "cm"),
label.fontface = "plain",
label.minwidth = 0,
label.margin = margin(2, 2, 2, 2, "pt"),
label.lineheight = 0) +
# expanding to give a bit more space for labels
scale_x_continuous(expand = expansion(mult = 0.1)) +
scale_y_continuous(expand = expansion(mult = 0.1)) +
coord_fixed() +
theme_classic() So only the main question remains: to do it without building the unnessary hulls. |
I realized, that I think I can provide a draft pull request, if the general idea sounds reasonable. |
Hi @assaron, I'm also interested in this border plotting of groups. Do you have your algorithm available somewhere? thanks |
@ppaxisa the border algorithm is available in https://github.com/alserglab/mascarade package |
Related to: #321
I have my own algorithm to calculate the border of points group, but would like to use your label location procedure. Do you think it'd be possible to extract something like
geom_mark_polygon
from the current code?This is the plot I'm interested to add labels to:
border_example.rda.gz
Currently, the best I can do is something like this, relying on
geom_mark_hull
:However, I don't need to actually build a hull, since I have already have a proper polygon, and I don't want to have an additional dependency.
There are also couple of other questions:
fill=NA
doesn't seem to work as I would expect.The text was updated successfully, but these errors were encountered: