Edit: This question addresses how to color only subsets of the x-axis labels. This is not a duplicate question.
I have made the x-axis labels to represent a nucleotide sequence, and I would like to add color to different sections of the nucleotides. How? Thanks.
ggplot(data = miRNA3) +
geom_line(mapping = aes(x = Position, y = Count_combined)) +
scale_y_continuous(breaks = seq(0, 120, 10)) +
ylab("Count") +
scale_x_continuous(breaks=1:150, labels=c("T", "G", "A", "T", "G", "T", "C", "C", "G", "T", "G", "T", "C", "C", "A", "C", "T", "C", "G", "T", "T", "G", "T", "T", "T", "T", "C", "A", "A", "C", "T", "T", "C", "T", "T", "C", "C", "C", "G", "C", "A", "A", "T", "T", "T", "A", "C", "C", "T", "T", "C", "A", "T", "G", "G", "T", "T", "A", "A", "A", "C", "A", "A", "T", "A", "A", "A", "T", "C", "A", "G", "C", "T", "A", "A", "G", "G", "T", "A", "T", "G", "G", "A", "C", "A", "C", "T", "G", "T", "A", "A", "C", "T", "A", "C", "T", "C", "T", "G", "A", "A", "G", "G", "T", "A", "A", "G", "T", "T", "G", "C", "G", "A", "G", "A", "G", "G", "A", "A", "G", "T", "T", "T", "C", "A", "A", "G", "T", "A", "G", "C", "A", "T", "T", "G", "G", "A", "T", "T", "C", "G", "G", "A", "C", "G", "T", "T", "A", "T", "G"), expand = c(0, 0)) +
xlab("Supercontig_1.4289:xxx-xxx") +
theme(panel.grid.minor.x=element_blank(),
panel.grid.major.x=element_blank(),
panel.grid.minor.y=element_blank())
Edit: I would like to make something like this (see the letters on the x-axis):