I am trying to develop a boxplot using the following sample code:
a<- ggplot(na.omit(dataframe), aes(x=Type, y=X_cells, fill=as.factor(response))) + geom_boxplot()
a + ggtitle("Sampletext") +
ylab("X cells") + scale_fill_discrete(name = "Response", labels = c("Negative", "Positive")) +
theme(plot.title = element_text(face = "bold", hjust=0.5))
However, this results in a plot with a total of 6 categories on the x-axis, where each category has 2 boxes (one for positive and one for negative) yielding a total of 12 boxplots. The 6th category is extra displayed as '0' in the axis that I would like to remove. Is this possible?
Also, is there a way to display datapoints in the boxplots for both Positive and Negative boxes?
Thanks!