[R] xyplot/levelplot: thickness of tickmarks

Deepayan Sarkar deepayan.sarkar at gmail.com
Sun Mar 5 03:58:45 CET 2006


On 3/4/06, Jan Marius Hofert <m_hofert at web.de> wrote:
> Hi,
>
> if I use the xyplot (or levelplot) function (lattice library) with
> the option axs="i", I have the problem that the tickmarks lie a bit
> outside the "plot-box". Consider for example:
>
> library(lattice)
> x<-seq(0,1,by=0.01)
> y<-seq(0,1,by=0.01)
> xyplot(y~x,type="l",xlim=c(0,1),ylim=c(0,1),scales=list
> (relation="free",axs="i",x=list(at=c(0.0,1.0)),y=list(at=c(0.0,1.0))))
>
> As you can see at x=1, half of the tickmark is actually to the right
> of the "plot-box" (just zoom in to see that...). Sure you can solve
> this by using a bigger smaller/bigger value for the ranges of xlim
> and ylim, but is there any option/way to fix that? I do not like to
> set xlim=c(-0.001,1.001) and ylim=c(-0.001,1.001) which would solve
> the problem but this is somehow "dirty". I couldn't find an option
> for the thickness of the tickmarks (that would solve the problem as I
> think the tickmarks-thickness is just bigger than the thickness of
> the axes)

The problem is not the line widths, but that half of the line in the
bounding rectangle is clipped off. You can work around it by adding

par.settings = list(clip = list(panel = FALSE))

to your xyplot call. I will probably make this the default behaviour eventually.

Deepayan
--
http://www.stat.wisc.edu/~deepayan/




More information about the R-help mailing list