I am creating a dot plot using ggplot2
something like this:
ggplot(data=GraphData, aes(x = VisitXC, y = DoseNormConc, fill = Study)) +
geom_dotplot(binaxis = 'y', stackdir = 'up', dotsize = 4,
position = "dodge", binwidth=5) +
scale_fill_manual(values = c("blue", "red","green", "purple", "orange"))
I am currently stuck in two things:
How to order the Study in a particular order as currently it is displaying in alphabetical order, and I need to display the dots in a specific Study order
I was able to display N on top of each dotpot using the following
Code:
geom_text(data = GraphData,
aes(x = factor(VisitXC), y = 1200, label = paste0("N=", NSub), color = color),
position = position_dodge(width = 1), show.legend = F)
but the color of each N=XX on top of the dots are not consistent with the colors I have chosen to display.