dusadrian / venn

Draw Venn Diagrams
30 stars 7 forks source link

Fix the line offset for the title if the `line` is not defined by user #29

Closed mmahmoudian closed 5 months ago

mmahmoudian commented 5 months ago

In the current version, if the user defines main argument (which is passed to title() but does not define the line argument, the title will be printed at the edge of the plot. In this PR we check the value, and if the user have not defined the line, we default to -1 to cleanly show at least one line of title.

venn(list(a = letters[1:4],
          b = letters[3:8]),
     main = "test")

image

To justify value -1, here is some different offsets overlaid:

venn(list(a = letters[1:4],
          b = letters[3:8]),
     main = "on line -1",
     line = -1)

title(main = "on line -2", line = -2, col.main = "red")
title(main = "on line 0", line = 0, col.main = "red")

image

dusadrian commented 5 months ago

Thanks Mehrad, I merged your PR.