Rotate Axis Labels in R - HH Package

Rotate Axis Labels in R - HH Package



Any suggestions on rotating the axis labels in a plot from the HH package in R?



In the example below, I would like the labels A, B, and C to be at a 45-degree angle. 'rot' only rotates the ticks, and text(object, srt=45) doesn't seem to work.


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)




1 Answer
1



Here is an approach:


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



This is the same as with other lattice graphs. A two element vector is provided for the rotation of bottom and upper labels.



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)