更改条形图中的条形宽度(R) [英] Change width of bars in barchart (R)

查看:62
本文介绍了更改条形图中的条形宽度(R)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在barchart()函数中更改条形的宽度.

I am wondering how to change the width of the bars in the barchart() function.

这是代码:

rater1 <- c(0.75, 0.66, 0.73,   0.63)
barplot(rater1, ylim=c(0:1),axes = TRUE, names.arg = c("A", "B", "C", "D"), axisnames=TRUE, col="grey70")

是否还可以在条形上方放置值标签?

Is it also possible to place value labels above the bars?

谢谢.

推荐答案

来自?barplot :

space:空间量(以平均条形宽度的分数表示)在每个小节之前离开.可以是一个或一个每个酒吧的人数.[...]

space: the amount of space (as a fraction of the average bar width) left before each bar. May be given as a single number or one number per bar. [...]

例如,比较:

tN <- table(Ni <- stats::rpois(100, lambda = 5))
barplot(tN, col = rainbow(20))

barplot(tN, col = rainbow(20), space=0)

barplot(tN, col = rainbow(20), space=10)

这篇关于更改条形图中的条形宽度(R)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆