HI @alla , is better try to help you if put the reprex.
Try with this
head(dput(data, 100)) #
For more control in which color you want, you could addscale_fill_manual()
If you have 20 taxon you need 20 color. Don't forget the color for NA value or omit.
For select better color (RGB) check this page and put the number with # for each color.
library(tidyverse)
ggplot(data,x = "SampleID", fill = "Class") +
geom_bar()+
scale_fill_manual(values = c('red', 'blue', 'green','red', 'blue',
'#AA9539', '#256F5C', '#AA6339',' #3E3175', '#D6D214', #You could change manual color
'red', 'blue', 'green','red', 'blue',
'red', 'blue', 'green','red', 'blue',
'red', 'blue', 'green','red', 'blue'))