[R] mixing different modes of lty line type specification in legend() ?

Marcus Eger eger.m at gmx.de
Wed Jun 5 17:34:29 CEST 2002


On Wednesday 05 June 2002 16:53, Uwe Ligges wrote:

> Marcus Eger wrote:
> > legend(x, y, c("A","B","C"), lty=c("11", "22", "42"),lwd=3)
> > But, unfortunately, solid lines do not seem to supported in "string"
> > mode.
>
> Was a misunderstanding, sorry ...
>
> Not really tested: Does "0" the trick?

Hhmm. 
 plot(1:10,type="l",lwd=3,lty="0")

works, but unfortunately not in legends:

 legend(x, y, c("A","B","C"), lty=c("0", "22", "42"),lwd=3)

It just leaves the first line blank.
I think it is because legend simply does not process lty elements less equal 
zero (not distinguishing between strings and numbers):

"legend" <-
  function( .......
......
 if (do.lines) {
    seg.len <- 2
    ok.l <- if (missing(lty)) {
      lty <- 1
      TRUE
    }
    else lty > 0
browser()
.......

Browse[1]> ok.l
[1] FALSE  TRUE  TRUE


+-------- ><> -------------------------------------------
| E-Mail: eger.m at gmx.de (NEW)
|         marcus.eger at physik.uni-marburg.de (OLD)
| WWW:    http://neuro.physik.uni-marburg.de/~eger (NEW)
+--------------------------------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list