[R] lattice::xyplot axis padding with fontfamily="mono"

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri May 29 00:08:59 CEST 2009

On Wed, May 27, 2009 at 4:38 PM, Benjamin Tyner <btyner at gmail.com> wrote:
> Hello,
> Say I have a predictor taking a very wide value:
>  Data <- data.frame(pred="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",resp=1)
>  print(xyplot(pred~resp, data=Data)) # enough y-axis padding to accommodate
> the wide label
>  print(xyplot(pred~resp, data=Data,scales=list(fontfamily="mono"))) # not
> enough padding

It's a bug in the layout calculations (fontfamily is not used).

> What's the recommended way to have enough padding allocated?

Ideally by fixing the bug, but that may not be easy to fix in the
short run. For one-off examples, you could increase the width

xyplot(pred~resp, data=Data,scales=list(fontfamily="mono"),
par.settings = list(layout.widths = list(axis.left = 1.1)))


More information about the R-help mailing list