如何在另一行图内使直方图较小
我希望像以下内容一样制作一个情节:
plot(cp1cold,"overall",col=4,ylab="RR",xlab="Temperature",xlim=c(-5,35),
ylim=c(-0.5,3.5),axes=F,lwd=1.5)
lines(cp1hot,"overall",ci="area",col=2,lwd=1.5)
axis(1,at=-1:7*5)
axis(2,at=c(1:7*0.5))
title("Overall cumulative association and temperature distribution")
mtext("London 1993-2006",cex=0.75)
par(new=T)
hist(lndn$tmean,xlim=c(-5,35),ylim=c(0,1200),axes=F,ann=F,col=grey(0.95),breaks=30)
abline(v=quantile(lndn$tmean,c(0.01,0.99)),lty=2)
abline(v=cen,lty=3)
axis(4,at=0:4*100)
mtext("Freq",4,line=2.5,at=200,cex=0.8)
可以在此处找到哪个代码:
我的情节带有巨大的直方图。 有人知道如何使该直方图较小吗?
obs:我尝试使用不同的布局,将每个图都放在一个线层中,但在美学上并不令人愉悦
I wish to make a plot just like the following:
plot(cp1cold,"overall",col=4,ylab="RR",xlab="Temperature",xlim=c(-5,35),
ylim=c(-0.5,3.5),axes=F,lwd=1.5)
lines(cp1hot,"overall",ci="area",col=2,lwd=1.5)
axis(1,at=-1:7*5)
axis(2,at=c(1:7*0.5))
title("Overall cumulative association and temperature distribution")
mtext("London 1993-2006",cex=0.75)
par(new=T)
hist(lndn$tmean,xlim=c(-5,35),ylim=c(0,1200),axes=F,ann=F,col=grey(0.95),breaks=30)
abline(v=quantile(lndn$tmean,c(0.01,0.99)),lty=2)
abline(v=cen,lty=3)
axis(4,at=0:4*100)
mtext("Freq",4,line=2.5,at=200,cex=0.8)
Which code can be found here: https://github.com/gasparrini/2014_gasparrini_BMCmrm_Rcodedata/blob/master/03.graphs.R
However, no matter what I try, when I try using my own data my plot comes with a huge histogram.
Do someone know how to make this histogram smaller?
OBS: I have tried using a different layout, putting each plot in one line layer, but it was not aesthetically pleasing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的数据具有很高的值四个直方图。您的上限值(1200)低于您的较高值。因此,您的直方图超过了其边界。您必须在“ Ylim = C(0,1200)”处更改上限值。
Your data have very high values four your histogram. Your upper limit value (1200) is lower than your higher values. Because of that, your histogram exceeds its boundries. You must change the upper limit value at "ylim=c(0,1200)".