我正在尝试使用boxplot ggplot2在400个人口中显示一个观察值。 我可以使用文本来显示它,但是我想使用与其他颜色不同的点来显示。 到目前为止,这是我设法编写的代码。 [![我还添加了一张有关结果外观的图片] [1]] [1]


HEXACO<-data10[, c("Record","Emotionality","Extraversion", "Agreeableness", 
    "Conscientiousness","Openness", "Honesty_Humility")]

data_long <- gather(HEXACO, hexaco, score, Openness, Conscientiousness, Agreeableness, Extraversion, 
    Emotionality, Honesty_Humility, factor_key=TRUE)

Oliver <-data_long[c(1, 11, 21, 31, 41, 51), c("hexaco", "score")]

HEXACO <- ggplot(data = data_long, aes(x= hexaco, y= score)) +
    geom_boxplot(width = 0.6, fill = "lightgrey", alpha = 0.5) +
    coord_flip() + 
    theme_USGS_box()+
    scale_y_continuous(breaks=c(0,0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5))+
    expand_limits(y = 1:5)+
    geom_text(data = Oliver, label = "Oliver",size = 3)+
    labs(title = "HEXACO Profile", x = "Honesty-Humilty", y = "Score")



[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/9QYmp.png

  ask by Zeina Al Khaznachi translate from so

本文未有回复,本站智能推荐:

关注微信公众号