[R] Resizing Stacked Figures

Gundala Viswanath gundalav at gmail.com
Tue Jun 17 03:05:24 CEST 2008


Hi,

I have two figures  where
I stacked together as one PNG.

Top -> scatter plot
Bottom -> density plot.

However the density curve on the bottom was cut-off
on its tip.

Is there a way I can resize the figure?
So that it can show  proportional and
complete plots?

The code I have is the following:

__BEGIN__
trellis.device("png", color=TRUE)
png(out_fname)

par(mfrow = c(2,1))

scat <- plot(gexp.arr,
              type = "l",
              col="red",
              xlab="Sample",
              ylab="Exp Lvl",
              main=paste(genm,"-",desc, ", Mean=",ge_mean, ", SD=",ge_sd, ",
              Krt=",ge_kurt, ", AIC=",aic, ", BIC=",bic, sep=""),
              split=c(1,1,1,2), more = TRUE
      )

gehist <- hist(gexp.arr,
              col="blue",
              main = "Density Plot",
              xlab = "Exp Level",
              freq=FALSE
  )

lines(density(gexp.arr), col = "red",lwd = 3, split=c(1,2,1,2))
dev.off()
__END__

- Gundala Viswanath
Jakarta - Indonesia



More information about the R-help mailing list