Create stacked barplot where each stack is scaled to sum to 100%
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a data.frame like this: df <- read . csv ( text = "ONE,TWO,THREE 23,234,324 34,534,12 56,324,124 34,234,124 123,534,654" ) I want to produce a percent bar plot which looks like this (made in LibreOffice Calc): Thus, the bars should be standarized so all stacks have the same height and sums to 100%. So far all I have been able to get is is a stacked barplot (not percent), using: barplot ( as . matrix ( df )) Any help? 回答1: Since you tagged this with ggplot2 here's a solution using that package (version 0.9.0) in addition to