0

I am trying to plot a likert scale of a 1 - 7 scale for every country with the likert package in R, but the R base plot() function won't change any of the text sizes (or even add a main title).

I am generating the plot with:

p <- likert(summary = data )

plot(p, 
   plot.percents=FALSE, 
   plot.percent.low=FALSE, 
   plot.percent.high=FALSE,
   include.center=TRUE, 
   plot.percent.neutral = FALSE, 
   col = c(brewer.pal(n = 7, name = "RdBu")), 
   cex.axis = 0.5, 
   cex.lab=0.5, 
   main = "title")

Which produces the following plot: Plot of Countries of the World

All the other plot parameters are working, so I'm not sure why the last 3, the most basic aren't working.

FLOX DAW
  • 1
  • 3

1 Answers1

0

I fixed this by using theme(axis.text) like so:

plot(p, 
   plot.percents=FALSE, 
   plot.percent.low=FALSE, 
   plot.percent.high=FALSE,
   include.center=TRUE, 
   plot.percent.neutral = FALSE, 
   col = c(brewer.pal(n = 7, name = "RdBu")), 
   main = "title") +
   theme(axis.text=element_text(size=4)

This doesn't answer the larger question as to why the plot() function isn't accepting the parameters, as the title still isn't showing, but it's a band aid solution

FLOX DAW
  • 1
  • 3
  • The package seems to have its own figure building functions. I think you should look at the parameters of the packages. Such as "text.size". https://cran.r-project.org/web/packages/likert/likert.pdf – Beeflight31 Jan 27 '23 at 07:39
  • Yes, and `plot.likert` seems to be a ggplot variant. The package documentation is incorrect regarding the lack of availability of pkg:ggExtra. It is still available. – IRTFM Jan 27 '23 at 07:48