Load required R packages
library(ggplot2)
library(reshape2)
Data organization
data <- melt(data, id.vars = 'level3', variable.name = "name", value.name = "value", level = 1)
Plot! (reordered by value)
ggplot(data, aes(x = name,y = value, fill = reorder(level3, value) )) + geom_bar(stat ="identity",width = 0.92,position ="stack", colour = "white") + theme_bw() + theme(panel.border = element_blank()) + theme(axis.line = element_line(size=0.8, colour = "black")) + theme(panel.grid = element_blank()) + theme(axis.title = element_blank()) + theme(axis.text = element_text(colour = 'black', size = 12)) + theme(legend.text = element_text(size = 10)) + theme(legend.title = element_blank()) + theme(axis.ticks.y = element_line(size=0.6)) + theme(axis.ticks.length.y = unit(0.15, 'cm')) + theme(axis.ticks.x = element_blank()) + guides(fill=guide_legend(ncol=1))

Change color!
library(RColorBrewer)
mycolors <- colorRampPalette(c(brewer.pal(12, "Paired")))(15) #1. expand the palette 2. why 15?
ggplot(data, aes(x = name,y = value, fill = reorder(level3, value) )) + geom_bar(stat ="identity",width = 0.92,position ="stack", colour = "white") + theme_bw() + scale_fill_manual(values = mycolors) + theme(panel.border = element_blank()) + theme(axis.line = element_line(size=0.8, colour = "black")) + theme(panel.grid = element_blank()) + theme(axis.title = element_blank()) + theme(axis.text = element_text(colour = 'black', size = 12)) + theme(legend.text = element_text(size = 10)) + theme(legend.title = element_blank()) + theme(axis.ticks.y = element_line(size=0.6)) + theme(axis.ticks.length.y = unit(0.15, 'cm')) + theme(axis.ticks.x = element_blank()) + guides(fill=guide_legend(ncol=1))

# another set
mycolors <- colorRampPalette(c(brewer.pal(8, "Accent")))(15)
ggplot(data, aes(x = name,y = value, fill = reorder(level3, value) )) + geom_bar(stat ="identity",width = 0.92,position ="stack", colour = "white") + theme_bw() + scale_fill_manual(values = mycolors) + theme(panel.border = element_blank()) + theme(axis.line = element_line(size=0.8, colour = "black")) + theme(panel.grid = element_blank()) + theme(axis.title = element_blank()) + theme(axis.text = element_text(colour = 'black', size = 12)) + theme(legend.text = element_text(size = 10)) + theme(legend.title = element_blank()) + theme(axis.ticks.y = element_line(size=0.6)) + theme(axis.ticks.length.y = unit(0.15, 'cm')) + theme(axis.ticks.x = element_blank()) + guides(fill=guide_legend(ncol=1))

Normalization by “position = ‘fill’”, so fucking convenient
ggplot(data, aes(x = name,y = value, fill = reorder(level3, value) )) + geom_bar(stat ="identity",width = 0.92,position ="fill", colour = "white") + theme_bw() + scale_fill_manual(values = mycolors) + theme(panel.border = element_blank()) + theme(axis.line = element_line(size=0.8, colour = "black")) + theme(panel.grid = element_blank()) + theme(axis.title = element_blank()) + theme(axis.text = element_text(colour = 'black', size = 12)) + theme(legend.text = element_text(size = 10)) + theme(legend.title = element_blank()) + theme(axis.ticks.y = element_line(size=0.6)) + theme(axis.ticks.length.y = unit(0.15, 'cm')) + theme(axis.ticks.x = element_blank()) + guides(fill=guide_legend(ncol=1))

Flip the plot!
ggplot(data, aes(x = name,y = value, fill = reorder(level3, value) )) + geom_bar(stat ="identity",width = 0.92,position ="fill", colour = "white") + theme_bw() + scale_fill_manual(values = mycolors) + theme(panel.border = element_blank()) + theme(axis.line = element_line(size=0.8, colour = "black")) + theme(panel.grid = element_blank()) + theme(axis.title = element_blank()) + theme(axis.text = element_text(colour = 'black', size = 12)) + theme(legend.text = element_text(size = 10)) + theme(legend.title = element_blank()) + theme(axis.ticks.y = element_line(size=0.6)) + theme(axis.ticks.length.y = unit(0.15, 'cm')) + theme(axis.ticks.x = element_blank()) + guides(fill=guide_legend(ncol=2)) + coord_flip() + theme(legend.position = 'bottom')

Change the coordinates!
ggplot(data, aes(x = name,y = value, fill = reorder(level3, value) )) + geom_bar(stat ="identity",width = 0.98,position ="fill", colour = "white") + theme_bw() + scale_fill_manual(values = mycolors) + theme(panel.border = element_blank()) + theme(axis.line = element_line(size=0.8, colour = "black")) + theme(panel.grid = element_blank()) + theme(axis.title = element_blank()) + theme(axis.text = element_text(colour = 'black', size = 10)) + theme(legend.text = element_text(size = 8), legend.key.size = unit(15, "pt")) + theme(legend.title = element_blank()) + theme(axis.ticks.y = element_line(size=0.6)) + theme(axis.ticks.length.y = unit(0.15, 'cm')) + theme(axis.ticks.x = element_blank()) + guides(fill=guide_legend(ncol=1)) + coord_polar(theta = "x")

Change the coordinates again!
ggplot(data, aes(x = name,y = value, fill = reorder(level3, value) )) + geom_bar(stat ="identity",width = 0.98,position ="fill", colour = "white") + theme_bw() + scale_fill_manual(values = mycolors) + theme(panel.border = element_blank()) + theme(axis.line = element_line(size=0.8, colour = "black")) + theme(panel.grid = element_blank()) + theme(axis.title = element_blank()) + theme(axis.text = element_text(colour = 'black', size = 10)) + theme(legend.text = element_text(size = 8), legend.key.size = unit(15, "pt")) + theme(legend.title = element_blank()) + theme(axis.ticks.y = element_line(size=0.6)) + theme(axis.ticks.length.y = unit(0.15, 'cm')) + theme(axis.ticks.x = element_blank()) + guides(fill=guide_legend(ncol=1)) + coord_polar(theta = "y")
