0

I want to make an xyplot with a large number of groups (on the order of 100). If I use the default setup it makes so many graphs on one page that I can't interpret what's going on. But if I naively change the layout it flips through too many plots at once. As in

trellis.device(device="png", filename="glm.png")
p = xyplot(value + hat ~ Time | variable, data=result, type='l', superpose=T, auto.key=T,      layout=c(5, 1))
print(p)
dev.off()

What's the best way to have fewer plots per page and still have everything in one image. Either with a scroll bar or a really long image?

John Montague
  • 1,910
  • 7
  • 21
  • 30
  • You can try to play with `height` and `width` options in `trellis.device()`. –  Aug 06 '14 at 10:33
  • You should say what behavior you want. Creating multi-page documents is possibile, although I think not in png format, but we need to know what number of plots per page is less than "too many". – IRTFM Aug 06 '14 at 11:03
  • Thanks guys. Probably 5 per page is about right. layout(5, 1) correctly limits it to 5 per page. But it just spits out the pages one by one. I tried the newpagpe, more options but they don't make a difference. – John Montague Aug 06 '14 at 11:07
  • png doesn't support multiple pages; you could use pdf instead. Alternatively, you could write a custom plotting device for knitr so that multiple png files are generated and placed sequentially in a html document. In short, what output format do you want? – baptiste Aug 06 '14 at 12:04

0 Answers0