From gb at stat.umu.se  Thu Mar 13 08:35:42 2003
From: gb at stat.umu.se (=?ISO-8859-1?Q?G=C3=B6ran_Brostr=C3=B6m?=)
Date: Thu Mar 13 08:33:43 2003
Subject: [Rd] plot() with type="s" and lty=2 (PR#2630)
In-Reply-To: <200303122236.h2CMa0n9021101@pubhealth.ku.dk>
Message-ID: <Pine.LNX.4.44.0303130830020.2139-100000@tal.stat.umu.se>

On Wed, 12 Mar 2003 jerome@hivnet.ubc.ca wrote:

> Full_Name: Jerome Asselin
> Version: 1.6.2
> OS: RedHat Linux 7.2
> Submission from: (NULL) (142.103.173.179)
> 
> 
> 
> In the following example, the line type lty=2 does not show properly
> across the entire line.
> 
> x <- c(seq(0,.5,.001),seq(.6,1,.1))
> y <- rep(1,length(x))
> plot(x,y,type="s",lty=2)
> 
> Sincerely,
> Jerome Asselin

Right. I reported this two days ago on 'r-help' (maybe the wrong place).
In the copy of my report below you also see the (a?) solution.

G?ran
-------------------------------------------------------------------
Consider the following two ways of stair steps plotting:

plo <- function(ty = 2, steps = 200){
  old.par <- par(mfrow = c(2, 1))
  x <- seq(1, 100, length = steps)
  y <- seq(1, 10, length = steps)
  plot(x, y, type = "s", lty = ty, main = "Stair steps")

  x <- rep(x, each = 2)[-1]
  y <- rep(y, each = 2)[-2*steps]
  plot(x, y, type = "l", lty = ty, main = "Line steps")
  par(old.par)
}
[...]
---------------------------------------------------------------------
---
 G?ran Brostr?m                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Ume? University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Ume?, Sweden             e-mail: gb@stat.umu.se

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> 

-- 
---
 G?ran Brostr?m                    tel: +46 90 786 5223
 Department of Statistics          fax: +46 90 786 6614
 Ume? University                   http://www.stat.umu.se/egna/gb/
 SE-90187 Ume?, Sweden             e-mail: gb@stat.umu.se


[Rd] plot() with type="s" and lty=2 (PR#2630)
=?ISO-8859-1?Q?G=C3=B6ran_Brostr=C3=B6m?=