Skip to content

lattice::xyplot axis padding with fontfamily="mono"

3 messages · Benjamin Tyner, Deepayan Sarkar

#
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

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

Thank you
Ben
#
On Wed, May 27, 2009 at 4:38 PM, Benjamin Tyner <btyner at gmail.com> wrote:
It's a bug in the layout calculations (fontfamily is not used).
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
manually:

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

-Deepayan
#
Deepayan,

Many thanks for the quick response and suggested workaround.

Best,
Ben
Deepayan Sarkar wrote: