When I add a color segmentation to ggplot and add geom_histogram using y=..density.., it produces a separate density for each color. I'm trying to get it to show a single density, and color code part of it.
If it were just a single chart, can get the right visual using y=..count... But, in a facet grid, the facets with smaller overall counts are visually too small:
ggplot(data=dataset, aes(x = myvariable, fill=factor(myfillfactor))) + facet_grid(cols = vars(myDimension1), rows = vars(myDimension2)) + geom_histogram(aes(y=..count..))
Using density makes the sizes more similar, but you can see that the 2 colors are actually 2 separate densities:
ggplot(data=dataset, aes(x = myvariable, fill=factor(myfillfactor))) + facet_grid(cols = vars(myDimension1), rows = vars(myDimension2)) + geom_histogram(aes(y=..count..)) + ylim(0,.2)
Any idea for having the density cover both colors? I also thought about keeping to a ..count.. and try to scale the facets, say by dividing each y value by the count of the group, but I don't know R well enough to see how to do that (I suppose that is what ..ncount.. does, but that produces separate densities too)