[R] How to plot two different lines with different color with the same "plot" function?

Petr Pikal petr.pikal at precheza.cz
Wed Nov 23 11:26:58 CET 2005



On 23 Nov 2005 at 16:59, ąăĐÇ wrote:

Date sent:      	Wed, 23 Nov 2005 16:59:38 +0800
From:           	"ąăĐÇ" <guangxing at ict.ac.cn>
To:             	"R-help at stat.math.ethz.ch" <R-help at stat.math.ethz.ch>
Subject:        	[R] How to plot two different lines with different color with the
	same "plot" function?

> Hi,R_Help!
> I have done something like this:
> >x<-seq(412,612,1)
> >plot(x,dpois(x,512),col="blue",type="l")
> >plot(x,dnorm(x,512,sd=sqrt(512)),col="red",type="l")
> And now,I want to plot the two lines in the same picture or with the
> same "plot" action? 

What should I do? And any advises? 	

Read some intro manuals.
Read help page for plot where you can find section see 
also.
Read help page for line.

If you still do not know how to plot line in existing 
plot, search help archives, read posting guide and as a 
last resort post your question again.

HTH
Petr


> 
> Thank you in advance!
> 
> 
> ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇąăĐÇ
> ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇguangxing at ict.ac.cn
> ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ2005-11-23
> 
> 

Petr Pikal
petr.pikal at precheza.cz




More information about the R-help mailing list