When producing a wide plot in lattice with margins that include panel.rug()
, the length of the lines in rugged margins is longer in the y-axis than x-axis:
library(lattice)
png(width=800, height=400)
xyplot(Fertility ~ Education, swiss, panel = function(x, y,...) {
panel.xyplot(x, y, col=1, pch=16)
panel.rug(x, y, col=1, end= ...)})
dev.off()
I would like those rug lines in x- and y-axes to be the same length regardless of the shape of a plot (note: right now the rug lines will only be the same length when the plot is square).