[R] Arrangement of Lattice Histograms - Top to bottom and then left to right?
Les
lnharris at zoology.ubc.ca
Tue Apr 5 20:37:09 CEST 2011
Hi List,
Using Lattice, I have created a plot of histograms showing Fork Length by
Year. The plot shows the histograms in 3 columns and 5 rows. Using the
as.table=T function I can get the years to start on top. However, what I
would like to do is have the first year start in the top left (column 1, row
1; as it is now) and add the subsequent histograms to the plot going down
the column and then over by row (example and current code is shown below).
Is this possible? I have spent a great deal of time searching, and have not
found any clues. Any help/ideas would be greatly appreciated.
For example, what is being done now:
1974 1975 1976
1977 1978 1979
1980 1981 1982
and what I am hoping for:
1974 1977 1980
1975 1978 1981
1976 1979 1982
Thank you kindly,
Les
data=read.csv("AllData.csv",sep=",",header=T)
data$year=as.factor(data$year)
ferg=data[data$wtrbody=="Ferguson",c(1:12)]
library(lattice)
strip.background=trellis.par.get("strip.background")
trellis.par.set(strip.background = list(col = grey(7:1/8)))
histogram(~fl|year, data=ferg, as.table=T, type="count",
col='dark grey',layout=c(3,5),lwd=2, lty=1,
xlab=list("Fork Length (mm)", cex=1.4,font=2),
breaks=seq(from=300,to=900,by=25),
ylab=list("Frequency",cex=1.4,font=2),
scales=list(font=2,cex=1.1, tck=c(1,0), alternating=1,
y=list(relation="free",tick.number=3)),
par.strip.text=list(cex=1.2),font=2,
aspect=0.6)
--
View this message in context: http://r.789695.n4.nabble.com/Arrangement-of-Lattice-Histograms-Top-to-bottom-and-then-left-to-right-tp3428825p3428825.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list