R - HH封装中的旋转轴标签

问题描述 投票:1回答:1

有关在R中的HH包中绘制轴标签的建议吗?

在下面的例子中,我希望标签A,B和C呈45度角。 'rot'只旋转刻度,而text(object,srt = 45)似乎不起作用。

library(HH)

test<-data.frame('A'=c(10,12,40,12),
             'B'=c(14,23,13,30),
             'C'=c(11,40,12,16))
rownames(test)<-c("No","Maybe","Plausible","Yes")

likert(t(test)[,1:4], horizontal = FALSE,as.percent = TRUE,
   main = NULL,
   xlab = "Percent", # becomes ylab due to horizontal arg
   ylab = "Condition", #xlab.top = "Total in Condition", 
   ylab.right = FALSE #removes Row Count Totals from Right)
r plot label axis
1个回答
1
投票

这是一种方法:

likert(t(test)[,1:4], horizontal = FALSE,as.percent = TRUE,
       main = NULL,
       xlab = "Percent", # becomes ylab due to horizontal arg
       ylab = "Condition", #xlab.top = "Total in Condition", 
       ylab.right = FALSE,
       scales = list(x = list(rot = c(45, 0))))

enter image description here

这与其他点阵图相同。提供双元素矢量用于旋转底部和上部标签。

© www.soinside.com 2019 - 2024. All rights reserved.