gghdr
gghdr copied to clipboard
Add conditional density estimation
Started in 91eeaf096da884c3167416dea56ea1610f958a65, but needs some testing because I'm sure I've broken something unexpected.
No x
ggplot(faithful, aes(y = waiting)) +
geom_hdr_boxplot(fill="steelblue") +
theme_minimal()
Categorical x
ggplot(faithful, aes(x = eruptions > 3, y = waiting)) +
geom_hdr_boxplot(fill="steelblue") +
theme_minimal()
Numeric x
ggplot(faithful, aes(x = eruptions, y = waiting)) +
geom_hdr_boxplot(fill="steelblue") +
theme_minimal()
with overlaid points for good measure
ggplot(faithful, aes(x = eruptions, y = waiting)) +
geom_hdr_boxplot(fill="steelblue") +
geom_point(alpha = 0.3) +
theme_minimal()
These look awesome! 👍
Amazing! :bee:
That looks beautiful! What else is missing from @mitchelloharawild original design implementation?
Good question @dvanic, I can't quite read that whiteboard pic in the other repo 😀 Maybe we should start another issue here for that discussion.
Hi @sparce could you push these changes to the repo so that I can test it? Right now with the following code it says -
ggplot(faithful, aes(x = eruptions, y = waiting)) + geom_hdr_boxplot(fill="steelblue") + theme_minimal()
gives the error message
Warning messages: 1: Continuous x aesthetic -- did you forget aes(group=...)? 2: Computation failed in
stat_hdrcde()
: Conditional density estimation is not yet supported. Make sure each plot group contains only one x value.
@Sayani07 are you trying in the cde
branch?
Oh no! Thank you