Hi I am trying to plot two simple graphs with a grid in background. The axis and grid appears in correct position, but the actual data are not there.... Can somebody provide me a hint what is missing? The code is: pln <- read.table(file="PLN.txt", header=TRUE, dec=",") par(mfrow=c(1,2)) plot(pln[,1], type="l", lwd="2", ylab="EUR/PLN", xlab=NULL, xlim = c(1993, 2011), ylim = c(2, 5), panel.first = grid(nx=NULL, ny=NULL)) plot(log(pln[,1]), type="l", ylab="EUR/PLN", xlab=NULL, xlim = c(1993, 2011), panel.first = grid(equilogs = FALSE)) Cheers. Sara [[alternative HTML version deleted]]
On Tue, Mar 15, 2011 at 12:01:45PM +0100, Sara Szeremeta wrote:> Hi > > I am trying to plot two simple graphs with a grid in background. The axis > and grid appears in correct position, but the actual data are not there.... > Can somebody provide me a hint what is missing? > > The code is: > > pln <- read.table(file="PLN.txt", header=TRUE, dec=",") > par(mfrow=c(1,2)) > plot(pln[,1], type="l", lwd="2", ylab="EUR/PLN", xlab=NULL, xlim = c(1993, > 2011), ylim = c(2, 5), panel.first = grid(nx=NULL, ny=NULL)) > plot(log(pln[,1]), type="l", ylab="EUR/PLN", xlab=NULL, xlim = c(1993, > 2011), panel.first = grid(equilogs = FALSE))pln[,1] is just one column, so you are not plotting the values vs the year but vs. their index. As xlim is set to the interval 1993-2011 you simply don't see your data... cu Philipp -- Dr. Philipp Pagel Lehrstuhl f?r Genomorientierte Bioinformatik Technische Universit?t M?nchen Wissenschaftszentrum Weihenstephan Maximus-von-Imhof-Forum 3 85354 Freising, Germany http://webclu.bio.wzw.tum.de/~pagel/
Thanks a lot!! It helped! 2011/3/15 Sara Szeremeta <sara.szeremeta@gmail.com>> Hi > > I am trying to plot two simple graphs with a grid in background. The axis > and grid appears in correct position, but the actual data are not there.... > Can somebody provide me a hint what is missing? > > The code is: > > pln <- read.table(file="PLN.txt", header=TRUE, dec=",") > par(mfrow=c(1,2)) > plot(pln[,1], type="l", lwd="2", ylab="EUR/PLN", xlab=NULL, xlim = c(1993, > 2011), ylim = c(2, 5), panel.first = grid(nx=NULL, ny=NULL)) > plot(log(pln[,1]), type="l", ylab="EUR/PLN", xlab=NULL, xlim = c(1993, > 2011), panel.first = grid(equilogs = FALSE)) > > Cheers. > Sara >[[alternative HTML version deleted]]