[R] RES: Multiple XY Lines Plot

Philipp Pagel p.pagel at wzw.tum.de
Tue Nov 11 21:27:49 CET 2008


> # prepare some example data
> x <- 1:25
> df <- data.frame(w1=x, w2=x+0.5, h1=x^2, h2=3*x+1.3)
> 
> # use matplot to graph all data at once
> matplot(df[,c('w1','w2')], df[,c('h1','h2')], type='l', lty=c('solid', 'dotted')) 

Oh - and matplot uses different line types anyway, so specifying
lty is unnecessary, unless you don't like the default choice.

cu
	Philipp

-- 
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany
http://mips.gsf.de/staff/pagel



More information about the R-help mailing list