I am trying to plot one scatter plot for each group, where each group has continous values in x-axis. Reference Data
Gives continuous x-axis but all groups are combined.
ggplot(data_for_plotting,
aes(x = log10(Count), y = log10(Nonsilent.Mutation.Rate), color=factor(Clusters))) +
geom_point(alpha = 1, size = 1) + theme_bw()
Gives grouped x-axis but the variation in x-axis is lost.
ggplot(data_for_plotting,
aes(x = factor(Clusters), y = log10(Nonsilent.Mutation.Rate), color=factor(Clusters))) +
geom_point(alpha = 1, size = 1) + theme_bw()
Does achieve the grouping but the gives multiple plots.
ggplot(data_for_plotting,
aes(x = log10(Count),y = log10(Nonsilent.Mutation.Rate),color=factor(Clusters))) +
facet_wrap(~ factor(Clusters), shrink = TRUE) +
geom_point(alpha = 1, size = 1) + theme_bw()
I want x-axis to be grouped based on Cluster where each cluster has continous x-axis values.