R Data Visualization Recipes
上QQ阅读APP看书,第一时间看更新

Drawing marginal histogram using gridExtra

If you seek a more tailor made result, there would be more code to do. The solution this recipe presents is to draw three plots and later arrange them into a 2x2 grid using the gridExtra package. Since it's a 2x2 grid there would be a blank space left to fill, let's move the legends there . This recipe works with ggplot2.