又悲剧了...刚造了图,结果发现png貌似能用layout...不知到有什么办法没,最近老悲剧,郁闷。[s:14]
</p>
<p>#png('image%d.png', width=73, height=73)<br />
x=rnorm(100)<br />
y=x^2+runif(100,0,3)<br />
zones=matrix(c(2,0,1,3),ncol=2,byrow=T)<br />
layout(zones,widths=c(2/3,1/3),heights=c(1/3,2/3))<br />
xhist=hist(x,plot=F)<br />
yhist=hist(y,plot=F)<br />
top=max(c(xhist$counts,yhist$counts))<br />
par(mar=c(6,6,1,1))<br />
plot(x,y,xlim=c(min(x),max(x)),ylim=c(min(y),max(y)),pch=20,col="grey70")<br />
lines(lowess(x,y),col="grey40")<br />
par(mar=c(0,6,1,1))<br />
barplot(xhist$counts,axes=F,ylim=c(0,top),space=0,col='green')<br />
par(mar=c(6,0,1,1))<br />
barplot(yhist$counts,axes=F,xlim=c(0,top),space=0,horiz=T,col='yellow')<br />
#dev.off()<br />
</p>