Say I have 2 datasets, 1 with 50 days on the x axis and one with 20 days, created with the code
par(mfrow=c(2,1))
data1=rnorm(50)
plot(data1,type='l',xlab='Days')
data2=rnorm(20)
plot(data2,type='l',xlim=c(0,50),xlab='Days')

In reality, day 1 in dataset 2 corresponds to day 20 in dataset 1 so I would like to plot dataset 2 such that the x axis, as above, goes from 0 to 50 but with the data being plotted from x=20 to x = 40. I’m guessing there’s an easy answer but I can’t find it online…
Thank you.
Pass
xandyarguments to plot.Though if you are plotting multiple datasets with the same axes, you are better off using ggplot2 or lattice. Your plots will look much better.