带有区别颜色的barplot,可显着正和负P值

发布于 2025-01-20 09:07:06 字数 442 浏览 3 评论 0原文

我的数据集包含 12 个月和 4 个季节(季风前、季风、季风后、旱季)及其与环宽指数相关的 r 和 p 值,

这是我使用的代码,

k <- read.csv("macro_r_p.csv",TRUE,",")

k
cols <- c("azure3", "red") [(k$p < 0.05)+1] 
barplot(k$r,names.arg=k$parameter,ylab="Correlation coefficient",col=cols,
        main = expression("T"[max]), las=2)

但是,我只能管理颜色对于正和负显着 p 值 (p < 0.05)。我想要一种不同的颜色表示积极的显着关系,另一种不同的颜色表示消极的显着关系。给我获得复杂文本字体(稍大一点)的代码会很有帮助。另外,我的图表高度没有正确调整。

my data set contains 12 months and 4 seasons (pre-monsoon, monsoon, postmonsoon,dry-season) and their r and p-value in relation to ring width index

here is the code I used,

k <- read.csv("macro_r_p.csv",TRUE,",")

k
cols <- c("azure3", "red") [(k$p < 0.05)+1] 
barplot(k$r,names.arg=k$parameter,ylab="Correlation coefficient",col=cols,
        main = expression("T"[max]), las=2)

but, I could only manage a color for both positive and negative significant p value (p < 0.05). I want one different color for positive significant relation and another different color for negative significant relation. It would be helpful to give me the code to get a sophisticated text font (a bit larger). Also, my graph height was not adjusted properly.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文