Exact axis ticks and labels in R Lattice xyplot -
i'm creating many plots (each separate image) must have identical axis limits. when using ylim, tick marks awkwardly placed @ extreme edges , tick labels omitted extreme values.
library(lattice) x=1:100 y=10+20*(runif(100)) xyplot(y~x) # case 1 - automatic ylim xyplot(y~x, ylim=c(10,20)) # case 2 - specified ylim
in case 1, axis ticks , labels automatically generated @ (y=10,15,20,25,30). tick marks labeled, , there vertical padding extreme tick marks (y=10 , y=30) in plot rectangle.
in case 2, when specify ylim values, tick marks generated @ (y=10,12,14,16,18,20) labels appear (y=12,14,16,18). tick labels missing @ extremes. also, there no vertical padding extreme tick marks in plot rectangle.
is there way specify ylim , still have tick marks , labels come out case 1?
more generally, when specifying ylim:
1. how can specify each tick mark goes?
2. how can specify tick marks labeled?
to tick marks , labels want, can along lines of:
xyplot( y~x, ylim=c(10,20), scales=list( y=list( at=seq(10,20,2), labels=c("a","","b","","c","") ) ) )
the padding issue, i'm not sure how address except manually adjusting ylim=
arguments.
Comments
Post a Comment