如何在另一行图内使直方图较小

发布于 2025-01-30 05:00:50 字数 1028 浏览 1 评论 0原文

我希望像以下内容一样制作一个情节:

”在此处输入映像说明“

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:

enter image description here

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?

enter image description here

OBS: I have tried using a different layout, putting each plot in one line layer, but it was not aesthetically pleasing

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光匆匆的小流年 2025-02-06 05:00:50

您的数据具有很高的值四个直方图。您的上限值(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)".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文