In order to better visualize my data, I want to apply scale_y_sqrt() function.
Without this function, the right number of sequences is associate, with 3 000 000 for the highest bar:
ggplot(nb_sequences,aes(x=ordre,y=count,fill=plante)) + geom_bar(stat='identity', width=0.6) + theme(
axis.text.x = element_blank(), plot.margin = unit(c(0, 0.5, 0, 3.7), "cm")) +
scale_fill_manual(values=c("#9F7CFC","#80b1d3","#fdb462","#b3de69","#ff4f4f")) +
theme(legend.position="left") +
guides(fill=guide_legend(title="Plant")) +
xlab('') +
ylab('Number of sequences') + scale_y_continuous(labels = scales::comma)
But when I apply the function, the number change to 10,000,000 in the wrong way:
ggplot(nb_sequences,aes(x=ordre,y=count,fill=plante)) + geom_bar(stat='identity', width=0.6) + theme(
axis.text.x = element_blank(), plot.margin = unit(c(0, 0.5, 0, 3.7), "cm")) +
scale_fill_manual(values=c("#9F7CFC","#80b1d3","#fdb462","#b3de69","#ff4f4f")) +
theme(legend.position="left") +
guides(fill=guide_legend(title="Plant")) +
xlab('') +
ylab('Number of sequences') + scale_y_sqrt(labels = scales::comma)
How could I fix it ?