I think there is a discrepancy between the faceted plots and the individual plot.
Pay attention to mouse number 9214 in these plots:
# Make the faceted graph
fig1 = ggplot(raw, aes(raw$Bregma.)) + geom_density() + ggtitle("Fig. 1. Bregma Representation, by mouse (red = post-ex, green = post-rev)") +
geom_density(data = raw_excluded, aes(raw_excluded$Bregma.), color = "red") +
geom_density(data = raw_revised, aes(raw_revised$Bregma.), color = "green")+ facet_wrap(~Mouse.ID.)
fig1
When I run the individual ggplot for that data, it looks like this, which is NOT what it looks like in the faceted image:
temp_indiv_plot = function(x) {
temp_mouse = x
temp_mouse_original = filter(raw, raw$Mouse.ID == temp_mouse)
temp_mouse_revised = filter(raw_revised, raw_revised$Mouse.ID. == temp_mouse)
ggplot(temp_mouse_original, aes(x = temp_mouse_original$Bregma.)) + geom_density() +
geom_density(data = temp_mouse_revised, aes(temp_mouse_revised$Bregma.), color = "green") +
ggtitle(temp_mouse)
}
temp_indiv_plot("8350")
temp_indiv_plot("9214")
But I plotted another mouse (8350) to see if it was consistent, but it looks identical to the faceted graph (can't add more than 3 links until I have enough reputation, you'll have to take my word for it now).
So why is mouse 9214 different?