[R] Reduce the space under legend title
Uwe Ligges
ligges at statistik.tu-dortmund.de
Fri Aug 12 16:48:44 CEST 2011
On 12.08.2011 01:28, Amelia McNamara wrote:
> I would like to know if there is a way to reduce the space between the
> legend title and the first line of the legend, without reducing all
> the vertical space using y.intersp. Because of lack of space, I would
> like to differentiate my title by bolding it, and reduce the vertical
> space under the title to the space typically used between categories
> in a legend.
>
> plot(c(1.1, 2.3, 4.6), c(2.0, 1.6, 3.2), pch=c(1,2,3))
> legend(x="bottomright", legend=c("Category 1", "Category 2", "Category
> 3"), title=expression(bold("Fairly long title")), pch=c(1,2,3),
> bty="o")
That is hardcoded in the legend() function. Hence a more or less dirty
hack or maybe better adapting the legend function for your needs is the
way to go.
Best,
Uwe Ligges
>
> ~Amelia McNamara
> Statistics PhD student, UCLA
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list