0

I have a matrix like this:

My_ABC
    A  B  C
a1 12 22 51
a2 33 11 39
b1 44 88 69
b2 12 10 49
c1 22 23 48
c2 11 44 58

I am making a grouped barplot using :

 barplot(My_ABC, col = plotting_colors, border = "white", beside = "True")

Now after doing some more analysis, I have percentages for four categories for each value b1, b2, a1, a2 etc. Now I want to add that information into my grouped barplot by showing the percentages in the form of stacked barplot for each bar in my plot. Can anyone help me do that? I found some examples that used the datafrrame to do this and I tried but I may not be adding the new information correctly or something, I am not getting the figure i want which is essentially a grouped barplot of stacked bars in R.

Lily Sharpton
  • 149
  • 1
  • 6
  • This sounds like a question that has been asked and answered multiple times. Have you done any searching? – IRTFM Dec 07 '19 at 05:56
  • Do you need https://stackoverflow.com/a/59207281/3962914 ? – Ronak Shah Dec 07 '19 at 06:53
  • The beside argument requires a logical value, either TRUE or FALSE, "True" is a character variable so it will probably be ignored. You say 4 categories for each value, but there are only 3 columns in your data? – dcarlson Dec 07 '19 at 23:00

0 Answers0