-
Notifications
You must be signed in to change notification settings - Fork 25
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
Scale circles to reflect overlap #13
Comments
Hi @tayaza! Thanks for asking this. So far the |
Thank you, @yanlinlin82. Understood. |
Hi everyone, I'd like to sincerely thank @yanlinlin82 for making this amazing package and @tayaza for bringing to the creator attention the "fixed-size circle issue". I'd love to make a Venn diagramm displaying the elements instead of count/percentage. Unfortunately, regardless of text_size and label_sep settings, the graph becomes unreadible. Scaling the size of the circles can be an absolutely valuable upgrade for this powerful package. @yanlinlin82 I'd really appreciate it if you'd implement the customazible-size argument. Thank you all for your time! |
Hi @GioBrug, I just submitted a new commit supporting auto-scaling circles for two sets (argument devtools::install_github("yanlinlin82/ggvenn") And then, library(ggvenn)
ggvenn(list(A = 1:8, B = 7:10), auto_scale = TRUE) BTW, this is a very early version just for testing. In addition, for three sets, it will take me more time to improve the code. So, please be patient to wait. |
Dear @yanlinlin82,
I'd like to sincerely thank you for the reply and submitting this trial
version. I'll contact you once I try it to give you a feedback. Regarding
the further improvement of the code, I appreciate your willingness to do
it. However, let me add that I'm currently dealing with four sets. Do you
think it could be possible to improve the code, according with you agenda,
to manage four sets instead of three?
I look forward to hearing from you.
Regards,
Giorgio Brugaletta
Il dom 3 ott 2021, 02:26 Linlin Yan (颜林林) ***@***.***> ha
scritto:
… Hi @GioBrug <https://github.com/GioBrug>,
I just submitted a new commit supporting auto-scaling circles for two sets
(argument auto_scale). You may try it by upgrading to the latest (test)
version code:
devtools::install_github("yanlinlin82/ggvenn")
And then,
library(ggvenn)
ggvenn(list(A = 1:8, B = 7:10), auto_scale = TRUE)
BTW, this is a very early version just for testing. In addition, for three
sets, it will take me more time to improve the code. So, please be patient
to wait.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV3VDXE7NHAPJNGRO42SLB3UFAASTANCNFSM4WNU6AJQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Dear @yanlinlin82, I've just tried the test version. As far as I'm concerned, a customazible-scale feature may be easier to manage and more effective than the auto-scaling - that, unfortunately, did not help me solve my problem - allowing the user to simply choose the desired circle/ellipse size. Do you think it is possible? Thank you again, Giorgio |
Hi @GioBrug, Well, scaling circle size for plotting three sets is still possible. However, it may take some time to consider pretty-looking as well. Therefore, I may finish that at least in a few weeks. Furthermore, it should be too complicated to scale circles for four sets simultaneously, including their intersections. That is the reason why I have no confidence to achieve the goal very soon. So, how about you try other better visualization methods, such as the UpSetR plot? |
Allowing the user to specify circle size directly is not a good option. In my opinion, an eligible API should help its user to avoid evil results, such as misleading large areas representing small values. So, unless it is absolutely necessary, I will not want to choose that way. |
Dear @yanlinlin82, Thank you for your time and giving me a heads up on UpSetR. Unfortunately, I have to necessarily make a Venn diagramm. I completely understand that ensuring a high quality plot and making a package as user-friendly as possible are vital commitments for great API like you. I apologize for bothering you. Best |
If you insist on using Venn, I guess you can draw it manually. Code from ggvenn package may help. Here goes a simple example: library(tidyverse)
gen_circle <- function(group, x_offset = 0, y_offset = 0, radius = 1,
radius_b = radius, theta_offset = 0, length.out = 100) {
tibble(group = group,
theta = seq(0, 2 * pi, length.out = length.out)) %>%
mutate(x_raw = radius * cos(theta),
y_raw = radius_b * sin(theta),
x = x_offset + x_raw * cos(theta_offset) - y_raw * sin(theta_offset),
y = y_offset + x_raw * sin(theta_offset) + y_raw * cos(theta_offset))
}
g <- ggplot() +
geom_polygon(aes(x = x, y = y),
data = gen_circle(group = 0L, x_offset = 0, y_offset = 0, radius = 1),
color = "blue", fill = "red", alpha = .5) +
geom_polygon(aes(x = x, y = y),
data = gen_circle(group = 0L, x_offset = 2, y_offset = 1, radius = 2, radius_b = 1),
color = "darkgray" , fill = "yellow", alpha = .5) +
geom_polygon(aes(x = x, y = y),
data = gen_circle(group = 0L, x_offset = 2, y_offset = 2,
radius = 3, radius_b = .5, theta_offset = -pi / 4),
color = "darkgreen" , fill = "green", alpha = .5)
print(g) |
@yanlinlin82, your example is tremendously enlightening! I'm grateful for all the work you've done. |
Hi,
Thank you for creating this. I was wondering if there's an option to make the circle areas represent the percentage of overlap, like the scale parameter in VennDiagram. Thank you!
The text was updated successfully, but these errors were encountered: