Closed lwlive closed 2 years ago
@lwlive you can use title()
set.seed(12345)
a <- list(first = sample(x = letters, size = 20, replace = TRUE),
second = sample(x = letters, size = 20, replace = TRUE))
venn(a,
zcolor = c(1,2),
box = FALSE,
ilcs = 2)
title(main = "some title here",
line = -2)
which will result in:
if you want to have the title closer to the venn, you should decrease the value of line
in the title()
.
Hi, dusadrian. I have made it according to your suggestion. Thanks for your kind help!
Thanks to @mmahmoudian , actually :)
@dusadrian it's my pleasure 😊
@dusadrian Coming back to this, I think there are some merit into letting user to set the title through main
argument. So far I have had my wrapper around venn for this and some custom stuff like turning off box and increase the ilcs
, but considering the general scheme of packages in R (including base), perhaps for the sake of consistency and usability, it might be a good idea implement this. The default value can be main = ""
to be backward compatible.
Hello @mmahmoudian, yes I think this would be easy to implement and sensible to have. Will do that in one of the next versions.
The latest commit solves this. Not via a formal argument "main" since that requires another argument "line" as per your solution in title() But you can actually provide the arguments "main" and "line" to function venn() via the three dots ... argument, just like you would provide the "main" argument to the base function plot(). Seems to work...
Hi, dusadrian. I am wondering if it is possible to add a title for the venn figure? Can you offer some help! Thanks!