[R] plot problems

Markus voigt markus-voigt at gmx.net
Mon May 21 21:08:35 CEST 2007


Hi Roland,

thanks for your help. I can see that your exapmle do that what I want to 
have. Here my source code because your solution doesn't work for my data:
currentarray etc. are vectors
table(currentarray)
currentarray
  2   3   4   5   6   7   8
 13  70 260 339 240  72   6
table(currentarray2)
currentarray2
  2   3   4   5   6   7
  1  17 189 506 261  26
table(probearray)
probearray
  1   2   3   4   5   6   7
 26  78 274 296 253  64   9
plot(table(currentarray)/1000,typ="b", 
col=c("red"),ylim=c(0,0.8),xlim=c(1,8))
lines(table(currentarray2)/1000,typ="b", col=c("blue"))
lines(table(probearray)/1000,typ="b", col=c("darkgreen"))

Markus


Roland Rau schrieb:
> Markus voigt wrote:
>> because it should start at 2. Is there a parameter where you can 
>> define the start on the x-axis?
>
> Maybe this will help you?
>
> datax1 <- 1:8
> datax2 <- 2:9
> datay1 <- runif(length(datax1))
> datay2 <- runif(length(datax2))
>
> plot(x=datax1, y=datay1, type="l", col="blue", xlab="X",
>      ylab="Y",xlim=range(c(datax1, datax2)), ylim=c(0,1))
> lines(x=datax2, y=datay2, col="red")
>
>
> Best,
> Roland
>



More information about the R-help mailing list