Quantcast
Channel: How to increase axis label text size in ggplot R? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How to increase axis label text size in ggplot R?

$
0
0

Hope this makes sense and thank you for your time in advance :)

I have made a bar chart to visualise the Gene Ontology enrichment of genes significantly downregulated in a microarray data set.

I am trying to increase the size of the title, "Fold enrichment", the numbers on the y axis and the labels on the x axis. I have managed to increase the size of the numbers labelling the bars (under geom_text), but I have been really struggling how to increase the size of the above text.

My txt file contents

process fold_enrichment FDR

Mammillary_axonal_complex_development 200 <0.01

Corticospinal_tract_morphogenesis 200 <0.1

Notochord_morphogenesis 200 <0.1

Somitogenesis 52.27 <0.01

Ossification 16.87 <0.1

Epithelial_tube_morphogenesis 12.85 <0.1

Regulation_of_cell_differentiation 4.92 <0.01

My code

dnfgfr1d <- read.table("dnfgfr1d.txt", header = TRUE)library(ggplot2) bc1d <- ggplot(dnfgfr1d, aes(x = reorder(process, fold_enrichment), y = fold_enrichment, fill = FDR)) +  geom_bar(stat = "identity", width = 0.5) +  ggtitle("Genes down regulated by dnFGFR1") +  geom_text(aes(label = fold_enrichment), nudge_y = 8, color = "black", size=4) +  scale_y_continuous(breaks = seq(0,220,by = 20), limits=c(0,220), expand=c(0,0)) +  xlab("") +  ylab("Fold enrichment") +  labs(fill='FDR') +  scale_x_discrete(labels=c("Regulation of cell differentiation","Epithelial tube morphogenesis","Ossification","Somitogenesis","Notochord morphogenesis","Corticospinal tract morphogenesis","Mammillary axonal complex development")) +  coord_flip() +  theme_classic() +  theme(plot.title = element_text(hjust=0.5))bc1d + scale_fill_manual(breaks = c("<0.01", "<0.1"),                          values=c("#3399CC", "#000099"))

enter image description here

Any help on this would be hugely appreciated as I have struggled with this for a while and I need to use this code repeatedly to generate multiple figures for my thesis.

Thanks,

Liv


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images