dusadrian / venn

Draw Venn Diagrams
30 stars 7 forks source link

Set names are intersecting circles #21

Closed dipongkor closed 1 year ago

dipongkor commented 1 year ago

What is the solution when snames intersect circles for 7 sets.

dusadrian commented 1 year ago

The 7 set diagram takes up a lot of space and it's difficult to space-accommodate any possible label width. The only solution I can think of is:

venn(7, snames = rep("", 7))
text(500, 500, "Mymodel")

The plot area is a square using 1000 x 1000 pixels, and in this way you can position your own labels anywhere you like. Does this solve the situation?

mmahmoudian commented 1 year ago

You can also use names with either extra white space before or after. Alternatively you can add \n

dipongkor commented 1 year ago

text(500, 500, "Mymodel")

Thanks. It solved my problem.

Another question. How can I set font-family.

dusadrian commented 1 year ago

For instance:

text(500, 100, "Mymodel", family = "Times")

If you cannot see any difference, try installing the package extrafonts and change myfont to whatever you want to use (and have installed on your computer):

install.packages("extrafonts")
library(extrafonts)
font_import(pattern = "myfont.ttf") # myfont has to already be present on the computer
text(500, 100, "Mymodel", family = "myfont")