[R] line length in legend
baptiste auguie
ba208 at exeter.ac.uk
Wed Dec 10 18:57:29 CET 2008
From the code of legend() the length seems to be hard-wired (seg.len
= 2). You could copy the code and add this "seg.len" as a free
parameter in your own custom function. An alternative is to use the
lattice package which has a size argument for this purpose. See ?
xyplot in the key section.
Hope this helps,
baptiste
On 10 Dec 2008, at 17:37, Gabor Grothendieck wrote:
> 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.
>>
>
> ______________________________________________
> 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.
_____________________________
Baptiste Auguié
School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK
Phone: +44 1392 264187
http://newton.ex.ac.uk/research/emag
More information about the R-help
mailing list