Message-ID: <5288ABCA.70608@xs4all.nl>
Date: 2013-11-17T11:43:06Z
From: Gerrit Draisma
Subject: Lattice: how to change the canvas size with Sweave
Dear all,
I would like to include a wide graph with narrow height in my LaTeX
output. Up to now I only get it done using Stangle and including
pdf("pietje-001.pdf",width=7,height=4)
xyplot(...)
dev.off()
What is the correct way of setting the canvas size?
Thanks.
Gerrit Draisma
==========pietje.tex
\documentclass{article}
\title{How to define the size of the plotting canvas?}
\author{Gerrit Draisma}
\begin{document}
\maketitle
I would like to make this a wide graph with a small height.
How do I do that?
<<>>=
library(lattice)
@
\raggedbottom
\begin{figure}[!h]
\centering
<<echo=FALSE,fig=TRUE>>=
xyplot(runif(11)~(0:10),type="l", aspect=0.4,
scales=list(x=list(tick.number=11),y=list(tick.number=3)))
@
\caption{The canvas is too big!}
\end{figure}
\end{document}
==========