[R] eliminating white space in lattice plot

Gerrit Draisma gdraisma at xs4all.nl
Fri Jan 17 17:18:26 CET 2014


Dear R-users,
How do I get rid of the white space above and under
a plot made with lattice xyplot?

I searched the documentation but could not find how to
do it.

Standard lattice plots are square,
but sometimes I want a wide but low graph
and use aspect parameter to obtain such a graph.
But then the plot has a lot of white space above and below
the graph.
That makes it more difficult to include in a LaTeX document.

Thanks,
Gerrit Draisma

=============
library(lattice)
X<-data.frame(x=1:100,y=runif(100))
# pdf("wideplot.pdf")
xyplot(y~x,data=X,type="l",aspect=0.25)
# dev.off()



More information about the R-help mailing list