Search code examples
rfontslikert

Font size in likert plots (HH package)


How can I control the size of labels and legend text?

This example is taken right of the HH documentation:

require(HH)
data(ProfChal)  ## ProfChal is a data.frame.
likert(Question ~ . , ProfChal[ProfChal$Subtable=="Employment sector",],
   main='Is your job professionally challenging?', ylab=NULL)

enter image description here

To be more specifically, I would like to increase the size of the five labels on the left side of the figure.


Solution

  • HH generates lattice plots, so lattice commands should work. To change the text size for the y-axis labels, add this line to your code: scales = list(y = list(cex = 1.2)), where cex in the multiplier to control the text size.

        library(HH)
    
        data(ProfChal)  ## ProfChal is a data.frame.
    
        likert(Question ~ . , ProfChal[ProfChal$Subtable=="Employment sector",],
           main='Is your job professionally challenging?', 
           ylab=NULL, 
           scales = list(y = list(cex = 1.2)))