Hello,

using Sweave, is there any option to preserve the
original aspect ratio of plots generated from R code?

Consider this Sweave chunk:
<<test,echo=F,fig=T,width=2,height=2>>=
x <- 1:10
y <- sin(x)
par(mar=c(4,4,0,4))
plot(x,y,
     xlab="x label",
     ylab="y label"
     )
@

In Latex, I want to produce a plot of width 2 but
don't care about the height. If I put the width and
height like shown on the example, the box isn't square
any more. But if I put only width or height in the
Sweave option, then the values then the appearance is
totally off. 

Is there any option for Sweave or other possibility to
preserve the ratio of the sides of plots?

Many thanks,
  Werner

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to