[R] line length in legend

Gabor Grothendieck ggrothendieck at gmail.com
Wed Dec 10 18:37:35 CET 2008


Perhaps you could just place the labels right on the graphs:

library(zoo)
z <- as.zoo(window(EuStockMarkets, end = 1992))
plot(z, screen = 1)
text(time(z)[1], z[1], colnames(z), cex = .6)


On Wed, Dec 10, 2008 at 11:58 AM, Giovanni Petris <GPetris at uark.edu> wrote:
>
> Hello,
>
> Is it possible to set the length of the lines appearing in a
> legend? For example, with
>
>> plot(window(EuStockMarkets, end = 1992), plot.type = "s", lty = c("13", "6413", "431313", "B4"))
>> legend(1991.7, 2200, legend = colnames(EuStockMarkets), lty = c("13", "6413", "431313", "B4"))
>
> I end up with a legend in which the "dot-dash" patterns of the
> different line types are hard to distinguish. With a longer piece of
> line that would be easier.
>
> Thank you in advance,
> Giovanni
>
> --
>
> Giovanni Petris  <GPetris at uark.edu>
> Associate Professor
> Department of Mathematical Sciences
> University of Arkansas - Fayetteville, AR 72701
> Ph: (479) 575-6324, 575-8630 (fax)
> http://definetti.uark.edu/~gpetris/
>
> ______________________________________________
> 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