我已经负责在工作中自动生成图形,并且需要一种在我们的条形图上显示比例的特定方法。目前我们拥有的是i.imgur.com/bWjk9.png
他们希望下面列出的每个音阶的价值。当我改变比例时,就会出现这样的情况。
i.imgur.com/1D9up.png
他们想要的方式就像不知道的方式(9)显示
这是我的图表代码,使用barplot2
在其他地方查找比例plot.graph <- function(data, px, py, scale_lab){
par(mar=c(5.1, 4, 1, 2))
#Plotting the Barplot
barplot2(summary(data),
#main = strwrap(heading, width = 50),
xlab = "Response",
ylab = "Number of Responses",
prcol = "#FAF4E6",
col = "#800000",
space = 1.5,
ylim = c(0, max(summary(data))+2),
names.arg = sapply(scale_lab,wordwrap,USE.NAMES=TRUE),
plot.grid = TRUE)
points(px, py, pch=21, cex=4, col="black", bg="yellow", lwd=1)
par(mar=c(5, 4, 4, 2) + 0.1)
}
非常感谢任何帮助。
卡梅伦。
答案 0 :(得分:0)
我自己想出来了,
对那些感兴趣的人来说,只需
mtext(text= c("(1)", "(2)", "(3)", "(4)", "(5)", "(9)"),side = 1, line = 2, outer = FALSE, at = c(2, 4.5, 7, 9.5, 12, 14.5))