Benjamin Tyner
2009-May-27 23:38 UTC
[R] lattice::xyplot axis padding with fontfamily="mono"
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
Deepayan Sarkar
2009-May-28 22:08 UTC
[R] lattice::xyplot axis padding with fontfamily="mono"
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 paddingIt'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 manually: xyplot(pred~resp, data=Data,scales=list(fontfamily="mono"), par.settings = list(layout.widths = list(axis.left = 1.1))) -Deepayan