降低Likert Chart R中条形的垂直厚度

时间:2014-07-31 05:39:30

标签: r data-visualization

我在R中制作图表。我很喜欢图表。我想减少酒吧的垂直厚度。有谁有想法吗。怎么做。以下是我的剧本。

require(likert)
require(HH)
Q2 <- c(11.76, 11.76, 17.65, 47.06, 11.76)
Q3 <- c(0, 17.65, 23.53, 23.53, 35.29)
Q4 <- c(5.88, 35.29, 23.53, 29.41, 5.88)
Q  <- data.frame(Q2, Q3, Q4)
Q  <- t(Q)
PCWP <- c("#A8C2C0", "#C9E9E6", "#AAFFBB","#D0E39A", "#A3B37B")
colnames(Q) <- c("Strongly disagree", "Disagree", "Neutral", 
                 "Agree", "Strongly Agree")
items <- list(c("Q2", "Q3", "Q4"))

likert(
       Q, col=PCWP, main="projects",
       xlab="Percentage", ylab="Question",
       par.settings= list(
                          layout.widths=list(axis.right=1, axis.key.padding=0,
                          ylab.right=1, right.padding=1)
                         )
      )

谢谢!

1 个答案:

答案 0 :(得分:1)

请参阅?likert(来自HH)。使用box.ratio参数:

likert(
       Q, col=PCWP, main="projects",
       xlab="Percentage", ylab="Question", box.ratio=0.5,
       par.settings= list(
                          layout.widths=list(axis.right=1, axis.key.padding=0,
                          ylab.right=1, right.padding=1)
                         )
      )