So I'm trying to plot two sets of data onto a single plot: one set (the BATH geom_text) to display 4 models' measurements, and another set (the geom_points) to display 77 different users' measurements.
preBATH<- monophs_allcoded %>%
filter(class == 'BATH') %>%
group_by(user, model)%>%
summarize(mean_pre_f1 = mean(f1_scaled_pre), mean_post_f1 = mean(f1_scaled_post), mean_pre_f2 = mean(f2_scaled_pre), mean_post_f2= mean(f2_scaled_post), model_f1 = mean(f1avg_scaledMODEL), model_f2 = mean(f2avg_scaledMODEL))%>%
group_by(user) %>%
ggplot() +
geom_text(aes(x= model_f2, y = model_f1, label = 'BATH', color=model))+
geom_point(aes(x= mean_pre_f2, y = mean_pre_f1, color =user))+
scale_color_manual(values=allcolors)+
guides(colour = guide_legend(ncol = 1)) +
expand_limits(x = c(0,2000)) +
expand_limits(y = c(0,600)) +
xlab("Lobanov-normalized and scaled f2")+
ylab("Lobanov-normalized and scaled f1")
preBATH <- preBATH + scale_y_reverse()
preBATH <- preBATH + scale_x_reverse()
Ideally, I would like two separate color aesthetic mappings for each set of measurements. From what I have gathered, ggplot won't allow this. I've come up with a workaround, by generating a set of colors and specifying the first four as colors I want to use for the model measurements (allcolors
) and specifying the colors manually in this line;
scale_color_manual(values=allcolors)+
However, ggplot seems to ignore this command. I've tried scale_fill_manual
with no luck. Any ideas on what I'm missing?