- Notifications
You must be signed in to change notification settings - Fork110
Open
Description
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 likegeom_mark_polygon from the current code?
This is the plot I'm interested to add labels to:
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"))+ coord_fixed()+ theme_classic()
Currently, the best I can do is something like this, relying ongeom_mark_hull:
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, aes(fill=NA,group=cluster,label=cluster),radius=0,expand=0,con.cap=0)+ coord_fixed()+ theme_classic()
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:
- Several label connectors (for example, NK, CD8 T, and others) lead to a split point between two clusters, resulting in a bit of ambiguity. Is there a way to fix it?
- Is there a way to remove fill?
fill=NAdoesn't seem to work as I would expect. - Is there a way to decrease the length of the connectors? They seem to be longer that I'd like, and I couldn't find an option to control it.
Metadata
Metadata
Assignees
Labels
No labels

