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

Martin Maechler maechler at stat.math.ethz.ch
Fri Jun 7 09:49:09 CEST 2002


>>>>> "Marcus" == Marcus Eger <eger.m at gmx.de> writes:

    Marcus> On Wednesday 05 June 2002 17:43, Uwe Ligges wrote:
    >> > 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.

as said this is a bug 
which will be fixed in 1.5.1 (due within this month).

    >> > I think it is because legend simply does not process lty elements less
    >> > equal zero (not distinguishing between strings and numbers):
    >> 
    >> legend(x, y, c("A","B","C"), lty=c("10", "22", "42"), lwd=3)

    Marcus> This does not work for me (R 1.4.1):
    Marcus> legend(x,y, c("A","B","C"), lty=c("10", "22", "42"),lwd=3)
    Marcus> does the same as
    Marcus> legend(x,y, c("A","B","C"), lty=c("1", "22", "42"),lwd=3)
    Marcus> or
    Marcus> legend(x,y, c("A","B","C"), lty=c("11", "22", "42"),lwd=3)

the latter two *should* be the same by definition ("1" is recycled to "11")
The "10" is a bit doubtful..

    Marcus> It just produces a narrow dot pattern.


    Marcus> Moreover, the lty="10" produces a ghostscript error
    Marcus> when plotted to postscript device:

  >>  Error: /rangecheck in --setdash--
  >>  Operand stack:
  >>	--nostringval--   0
  >>  Execution stack:
  >>	%interp_exit   .runexec2   --nostringval--   --nostringval--   
  >>  --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   
  >>  --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   
  >>  %oparray_pop   .runexec2   --nostringval--   --nostringval--   
  >>  --nostringval--   2   %stopped_push   --nostringval--   2   3   %oparray_pop 
  >>   --nostringval--   --nostringval--
  >>  Dictionary stack:
  >>	--dict:1035/1476(ro)(G)--   --dict:0/20(G)--   --dict:92/200(L)--
  >>  Current allocation mode is local
  >>  GNU Ghostscript 6.53: Unrecoverable error, exit code 1

I can confirm this.  I will have a deeper look.
{this is not a legend() problem, but a general `lty' one.}

Martin


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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