Hi all
I hope you might help me with some aspects of producing a graph in lattice. 
There are three things I have struggling with and that is: 1. to separate the 
horizontal box rows from each other; 2. to change the colour of the horizontal 
and vertical strips to white; and 3. to place the axes labels on the left y 
axes and on the bottom x axes. I would really appreciate some help. I have put 
the following example together. I tried "between=list(y=c(1))" to try and 
separate the horizontal box rows but perhaps I have not used this correctly. I 
tried to use the following to place the labels on the left y axes 
"scales=list(y=list(alternating=c(1))" but again perhaps I didn't use this 
correctly.
library(lattice)
library(latticeExtra)
n=as.factor(c(1:5,1:5))
Breed=as.factor(c(rep("Cow",3),rep("Sheep",3),rep("Goat",2),rep("Yak",2)))
Test=as.factor(c(rep("Bovine viral diarrhoea",5),rep("Border Disease",5)))
Titer=as.numeric(c(10,20,30,40, 50,15, 25, 35, 45, 55))
heif=data.frame(n,Breed, Test, Titer)
x=barchart( heif[,4]~ heif[,1]| heif[,3]+ heif[,2] ,ylab="titer",
layout = c(2,2), scales=list(x=list(at=c(seq(0, 60, by = 15)),tick.number=c(5),
labels=c(seq(0, 60, by = 15))))
)
useOuterStrips(x)

Kind regards
Andrew McFadden MVS BVSc | Veterinary Epidemiologist,
Investigation and Diagnostic Centre | Biosecurity New Zealand
Ministry of Agriculture and Forestry | 66 Ward St,  Wallaceville | PO Box 40 
742 | Upper Hutt | New Zealand
Telephone: 64-4-894 5611 | Facsimile: 64-4-894 4973| Mobile: 027-733-1791 | 
Web: www.maf.govt.nz




This email message and any attachment(s) is intended solely for the addressee(s)
named above. The information it contains is confidential and may be legally
privileged.  Unauthorised use of the message, or the information it contains,
may be unlawful. If you have received this message by mistake please call the
sender immediately on 64 4 8940100 or notify us by return email and erase the
original message and attachments. Thank you.

The Ministry of Agriculture and Forestry accepts no responsibility for changes
made to this email or to any attachments after transmission from the office.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to