Add annotations of X or Y labels in ggplot barplot
0
0
Entering edit mode
7.7 years ago
Ron ★ 1.2k

I want to add a scale of values as an annotation in ggplot bar plots.I am pasting my basic code:

p=ggplot(gene_df,aes(x=Sample,y=value))  + geom_bar(stat = "identity") + coord_flip() 
p <- p + xlab('Sample')
p <- p + ylab('Log of Expression Value') 
p <- p + theme_bw() + theme(axis.title.y = element_text(size = rel(1.8), angle = 90))
p <- p + theme(axis.title.x = element_text(size = rel(1.8), angle = 00))

I want to add multiple side bars shown here in the heat map figure :

How Do I Draw A Heatmap In R With Both A Color Key And Multiple Color Side Bars?

The only difference is instead of a heat map,I want to have a barplot since I am focusing on only ONE row instead of multiple rows.

So I would like to add colored yes/no annotations on the side bar as well as a color scale bar as another annotation of the different samples.

Here is my table:

Sample  gene     value
PM154_OM1   AURKA   2.377266429
PM160_Z7    AURKA   2.455818898
PM258_Z2    AURKA   3.138846287
PM315_Z3    AURKA   0.254079187
Sample_LM1  AURKA   2.279417733
Sample_LM2  AURKA   2.327119126
Sample_PM1  AURKA   1.863488775
Sample_PM11_Z8_1_RNA    AURKA   0.880872267
Sample_PM119_X1_1_RNA   AURKA   1.822568341
R ggplot heatmap • 3.6k views
ADD COMMENT

Login before adding your answer.

Traffic: 1951 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