Re: [R] Plotting multiple continuous lines with symbols

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Tue, 10 Jun 2008 12:28:01 -0400

Dear Tariq,

A good starting point would be ?matplot. Also, you can try this:

set.seed(123)
X=cbind(1:10,matrix(rnorm(10*5),ncol=5)) matplot(X[,1],X[,2:5],type='o',lty=1,col=1,pch=1:5,xlab="Variable X",ylab="Outcome")

and the add your any text you want around.

HTH, Jorge

On Tue, Jun 10, 2008 at 12:13 PM, Tariq Perwez <tariq.perwez_at_gmail.com> wrote:

> Hi,
> I am trying to plot multiple lines on one plot such that all lines are of
> the same color (black) and continuous. I need to distinguish these multiple
> plots from each other by using different symbols (I am using pch=).
> However,
> all my lines are broken on both sides of the symbols. This unfortunate (and
> unsightly) behavior seems to be the default. In my search of the help
> archives for R over several days, I have not been able to solve this
> problem. I would appreciate any help and suggestions. My code for the plot
> is below (minus the data):
>
> exa1.1 <- read.table("multcol.txt", header=T, sep=' ')# Total of 4
> columns; first one to be on x-axis
> attach(exa1.1)
> names(exa1.1)
> exa1.1
>
>
> plot(exa1.1$Year, exa1.1$EM, ylim=range(exa1.1[,-1]), type = 'b' ,pch=16,
> main = ""), las=1, cex.main=1.75,lab =c(12,8,10), ylab="", xlab="", )
> lines(exa1.1$Year,exa1.1$IM,type='b', pch=1)
> lines(exa1.1$Year,exa1.1$BM,type='b', pch=17)
> mtext(side = 2, text = "Klett units", line = 3.5, cex=1.2)
> mtext(side = 1, text = expression(Time~at~37*degree*C~(minutes)), line =
> 2.75,cex=1.2)
>
>
> Regards,
>
> Tariq
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

        [[alternative HTML version deleted]]



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. Received on Tue 10 Jun 2008 - 16:58:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 10 Jun 2008 - 17:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive