I was planning to produce a graph similar to this, which uses frequency data, but I can't seem to figure it out.
I was thinking that the legends below were just another barplot that the user have integrated with the original barplot. But I cannot produce the same barplot which utilizes a similar color for each bar it represents.
library(ggpubr)
library(colorspace)
library(ggsci)
ggbarplot(codons, width = 0.8,
y = "Count", Ticks = FALSE, sort.by.groups = TRUE,
x = "Amino_acid", Color = "Count", fill = "Count",
font.tickslab = "white",
legend = "none",
xlab = NULL,ylab = NULL,
position = position_fill(), ggtheme = theme_void())
I can get this. Though I can put labels inside, I cannot use other color palette aside from a blue gradient.