emilioxavier / theHUB

https://theHopefulBox.com/
Other
2 stars 0 forks source link

allow `likert.barplot.stacked()` to accept custom colour palettes #34

Open emilioxavier opened 1 year ago

emilioxavier commented 1 year ago

Hi The likert.barplot.stacked() function has the msu.palette hardcoded, preventing the use of custom colour palettes.

Please replace

scale_fill_manual(values=rev(msu.palette[1:5]), guide=guide_legend(reverse=FALSE)) + ## CURRENT

with

scale_fill_manual(values=rev(colour.palette), guide=guide_legend(reverse=FALSE)) + ## CURRENT

Might need to set the length of the provided colour palette to the number of levels within the Likert plot.

Thank you!

emilioxavier commented 1 year ago

Hi Maybe consider something similar to the method/code to ensure the same colours are applied to the same categories.

Emilio