Take the 2-minute tour ×

I'm trying to use a trellis theme to set all my graphing parameters to keep my plotting statements short. I can't seem to find the correct trellis parameter access tick mark length (or any scale parameters for that matter).


x = runif(100)
my.theme = trellis.par.get()
my.theme$axis.line = list(tck=c(4))     # this does not work
dp <- densityplot(~x)

# this works, but I want to do it using a theme
# dp <-densityplot(~x, scales=list(y=list(tck=c(4)))) 

png("dp.png", width=400, height=200)
plot(dp); dev.off()
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Tick lengths for each of the plot's axes are controlled by (elements of) axis.components in lattice's graphical parameter list.

Run str(trellis.par.get("axis.components")) to see what you are aiming for, and then do something like the following:

mytheme <- list(axis.components = list(left = list(tck=4), right = list(tck=4)))

enter image description here

share|improve this answer

Your Answer


