plotting stacked bar plot with different number and kinds of variables
1
0
Entering edit mode
2.9 years ago
Curls ▴ 40

Hi,

I am trying to create a stacked bar plot using the data below. I want to show A, C and D on the x axis. "A" has four variables (GCU,GCC,GCA,GCG) and I want to show these variables as a stacked bar with their percentages (as shown in the last column). I tried to use ggplot but could not make it. Any help will be appreciated.

enter image description here

stackedbarplot ggplot • 849 views
ADD COMMENT
1
Entering edit mode

Please do not paste screenshots of plain text content, it is counterproductive. You can copy paste the content directly here (using the code formatting option shown below), or use a GitHub Gist if the content volume exceeds allowed length here.

code_formatting

ADD REPLY
0
Entering edit mode

Thanks for the information. I did not know this option.
I am going to use it for my new posts.

ADD REPLY
1
Entering edit mode
2.9 years ago
MikeV ▴ 10

It shouldnt be too difficult using ggplot2, but try the R package ggpubr for something more user friendly.

ggbarplot(data = mat , x = "code", y = "percent", fill = "codon" ) 
ADD COMMENT

Login before adding your answer.

Traffic: 2817 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6