I believe you can simply modify the panel function to replot the axes
on top with panel.axis(),
library(lattice)
model <- function(a,b,c,d,e, f, X1,X2) # provide model function
# for contour plot
{J <- a + (b*X1) + (c*X2) + (d*X1*X2) + e*(X1^2) + f*(X2^2)
pp <- exp(J)/(1+exp(J))
return(pp)}
g <- expand.grid(X1= seq(0.3,0.9,0.01), X2 = seq(0.3,1, 0.01))
g$z <- model(-29, -14, 52, 80, -3, -56, g$X1, g$X2) # Create
# variable z using gridded data, model, and variables
contourplot(z ~ X1 * X2,panel=function(...){panel.levelplot(...);
panel.axis("bottom", half = FALSE,labels=F)
panel.axis("left", half = FALSE,labels=F)
},
data = g,
region = TRUE, # Adds color to background
cuts = 10, # Number of contour intervals...(and
color
# intervals!)
scales = list(tck = c(-1,-1)) # ticks go inward
) ### END
Hope this helps,
baptiste
On 24 Nov 2008, at 16:35, Seth W Bigelow wrote:
I wish to have inward-pointing ticks on my contourplot graph, but the
colored background produced by the "region=TRUE" statement covers the
ticks up, is there any way around this? Sample code below. --Seth
library(lattice)
model <- function(a,b,c,d,e, f, X1,X2) # provide model
function
for contour plot
{J <- a + (b*X1) + (c*X2) + (d*X1*X2) + e*(X1^2) + f*(X2^2)
pp <- exp(J)/(1+exp(J))
return(pp)}
g <- expand.grid(X1= seq(0.3,0.9,0.001), X2 = seq(0.3,1, 0.001))
g$z <- model(-29, -14, 52, 80, -3, -56, g$X1, g$X2) #
Create
variable z using gridded data, model, and variables
contourplot(z ~ X1 * X2,
data = g,
region = TRUE, # Adds color to background
cuts = 10, # Number of contour intervals...(and
color
intervals!)
scales = list(tck = c(-1,-1)) # ticks go inward
) ### END
[[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.
_____________________________
Baptiste AuguiƩ
School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK
Phone: +44 1392 264187
http://newton.ex.ac.uk/research/emag
______________________________________________
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.