I'm looking for a way to plot the density and boxplot of a feature to compare two groups. I tried using ggboxplot and ggdensity to get both plots, however, when I wasn't able to find a way to combine them in a way that their axis are adjusted with each other (using cowplot::plot_grid or ggpubr::ggarrange).
The ggscatterhist is pretty much what I'm looking for. I can choose the margin plot, but I couldn't find a way to change the main scatter plot to a boxplot or density. Am I missing something?