HH::plot.likert() adding outline to bars

Hi,
maybe anybody know how to add borders to bars in plot.likert() function from HH package ?

Here below there are some examples of Likert's plots. I would like to use plot.likert function not likert() function form HH package and add black outline to bars.

https://jtr13.github.io/cc19/how-to-plot-likert-data.html

https://stackoverflow.com/questions/64801495/hh-package-in-r-border-around-key-in-likert-plots

Any thoughts will be much appreciated.

I have read that HH package uses lattice package under the hood especially barchart() function.
My question would be how to get to that function from HH package to modify bars ?
Another thing is that when I use this code:

library(HH)
data("ProfChal")

HH::likert(Question ~ . , ProfChal[ProfChal$Subtable=="Employment sector",],
       ylab=NULL,
       main = "",
       auto.key = list(columns = 1, reverse.rows = T),
       as.percent = T,
       borders = list()) # <- This draws borders around the bars in the plot

borders = list()) is used to draw borders around bars but somehow it always divides not necessarily center block (here No Opinion) in two parts. How to get rid of this center black line ?

library(HH)

data("ProfChal")

HH::likert(Question ~ . , ProfChal[ProfChal$Subtable=="Employment sector",],
       ylab=NULL,
       main = "",
       auto.key = list(columns = 1, reverse.rows = T),
       as.percent = T,
       borders = list()) # <- This draws borders around the bars in the plot

Created on 2022-12-16 with reprex v2.0.2

So my desired result will be that, without centering/dividing line in gray rectangle:

How do I do it, please ?

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.