> [R] Increase the size of the boxes but not the text in a legend
> Jürgen Biedermann
> to:
> r-help
> 08/21/2011 06:02 PM
>
> HI there,
>
> I want to add a legend to a plot using the density and angle argument,
> so patterns with lines in different angles are used in the plot and
> should be referred to.
> When I use default settings, the filled boxes are too small.
> With the cex argument I can enlarge the whole legend, but then the text
> gets too big.
>
> How could I just increase the size of the single boxes and not the text.
There is no way to do this with the legend() function. The cex= argument
controls both the text and the box size. You could either write your own
code to place rectangles and text on your plot, or you could create a
modified version of the legend() function to suit your needs.
Jean
>
> I tried:
>
> legend("topright", c("Trefferquote","Falschalarmquote"),
> density=c(20,16), angle=c(45,0),cex=1.5, y.intersp=0.8)
>
> The sizes of the boxes are good now, but the text is too large and so
> also the whole legend box gets too big.
>
> Thank you very much for your help
> Jürgen
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.