I want to plot a dotplot grouped as non colored figure but filled as the coloured one. To generate coloured I used:
Sample dataset:
data <- data.frame(estado1 = c('APLV','APLV','APLV','APLV','APLV','NO APLV','APLV','NO APLV','NO APLV','APLV','NO APLV','APLV','APLV','APLV','APLV','APLV','APLV','APLV','NO APLV','APLV'), combined_ige = c(3.6,2.84,1.2,14.33,0,0,0,0,0.07,2,0,0.3,0.11,0,0,1.31,0,0,0,0.19), sxtypes = c('skin_resp','skin','skin','skin_dig','dig','dig_resp','skin_dig','dig','dig','skin_resp','skin_dig_resp','dig','dig','dig_resp','skin_dig_resp','skin','dig','skin_dig_resp','resp','skin_dig'))
code
ggplot(data, aes(x=estado1, y=combined_ige, fill= sxtypes)) +
geom_dotplot(binaxis='y', stackdir='center',
stackratio=1.5, dotsize=1.2, alpha=0.6) +
geom_hline(yintercept = (0.35), linetype="dashed") +
geom_hline(yintercept = (0.77), linetype="dashed", col="red") +
xlab("Status group") +
ggtitle("IgE específicas combinadas") +
scale_y_log10(labels = function(y) format(y, scientific = F))
When I use "fill = sxtypes" in order to colour dots, them group in layers overlapping each other. I want them to stay in the same positions as in the not coloured figure at the time they colour as in the second figure.