yanlinlin82/ggvenn

"stroke_color" Multiple colors: is it possible?

Closed this issue · 3 comments

I would like to know if it is possible to define multiple colors for the stroke_color or if it is only possible to define one color.
This is my code:

a <- list(set1 = data[1:9, 2], set2 = data[1:3308, 3], set3 = data[1:2282, 4])

ggvenn(a, fill_color = c("seagreen2","orange1","gold"), fill_alpha= 0.5, stroke_size= 0.5, set_name_color=c("seagreen2","orange1","gold"), stroke_color=c("seagreen2","orange1","gold"), set_name_size=7,text_color="black", text_size=4.5, show_stats="c")

And this is the error I'm getting:

Error in geom_polygon():
! Problem while setting up geom aesthetics.
Error occurred in the 2nd layer.
Caused by error in check_aesthetics():
! Aesthetics must be either length 1 or the same as the data (300).
✖ Fix the following mappings: colour.
Run rlang::last_trace() to see where the error occurred.

the code only runs with stroke_color="grey"

Then I conclude that it is not possible to define more than one color. I would be grateful if someone could confirm this, or maybe there is another way to do this.
UV_Venn_SET_UP.txt

Thank you very much!! ;)

So far, it is not possible to specify distinct colors for the sets because the stroke color (as well as alpha, size, and linetype) is hard-coded here. If this feature is useful, I think we could consider adding it to the ggvenn package in future.

Thanks @yanlinlin82! Yes, totally agree; please consider adding multiple colors to stroke_color ;)