I wrote the following code to make time series plot by group.
nsplot<- xyplot(conc ~ time |Location, data=nspm1long,
ylim=range(nspm1long$conc),
main="PM1 time series by Location",
ylab="PM1 concentration (mg/m3)",
xlab="Time", type="l",
par.strip.text=list(cex=0.7),
par.settings=list(axis.text=list(cex=0.7)))
print(nsplot)
What I got is a block of thick line for the y-axis instead of the tickmarks like the x-axis. Would someone please help me fix the code. It would be even better if I could control the range of ylim like 0-0.5 and the number of tick marks.
I don’t know how to attach the image here and perhaps you could show me how too.
The output of your code looks fine for me. Here is what I get with some example data I made:
See
?xyplotfor the answers to all your plot formatting questions, specifically thescales,tick.number,ylim,tckparameters.