
上QQ阅读APP看书,第一时间看更新
Adding marginal histograms using ggExtra
Another way to go is to draw histograms or even density distributions in the margins. Drawing tailor made plots in the margins would require more code. On the other hand, if there is no need for greater customization ggExtra package can be used to spare many code lines. This recipe is demonstrating how to use ggExtra to easily draw histograms in the margins of a scatterplot.