I have the following plot but the x-axis labels are too small to read. If I increase the size they become overlapped and illegible
I have tried the code form the following link
But I get an error 'wrong sign in 'by' argument'
I also tried the following link How to show every second R ggplot2 x-axis label value?
but as a beginner I couldn't quite follow the code and aren't sure if there is an added complication with the labels being dates.
I have a df of 100 genes across 170 samples + a 'Genes' column. I then use the following code to make the data long:
mat_dataNew<-mat_data %>% gather(sample, expression, -Genes)
#log10-transform Counts data
mat_dataNew <- mutate(mat_dataNew, log10_NormCounts = log10(expression))
I then plot with:
ggplot(mat_dataNew, aes(x=reorder(Genes, -log10_NormCounts), y=log10_NormCounts, colour=Group)) +
geom_point(size=.5) +
theme(axis.text.x=element_text(angle=90, size=4)) +
labs(x = "100 most abundant Genes", y = "Gene Expression (Log10 Normalised Counts)")
I have tried reading about scale_x_continuous but couldn't seem to find an answer. Could you please help to suggest some code so that the x axis label is legible? I thought maybe the easiest option would be to display every other label???