美文网首页数据可视化
每日一图Marginal Histogram/Boxplot

每日一图Marginal Histogram/Boxplot

作者: 小明的数据分析笔记本 | 来源:发表于2018-03-07 22:33 被阅读39次

    原文链接Top 50 ggplot2 Visualizations - The Master List (With Full R Code)

    If you want to show the relationship as well as the distribution in the same chart, use the marginal histogram. it has a histogram of the X and Y avriables at the margins of the scatterplot.(如果你想要在同一幅图中既展示数据之间的关系,又展示数据的分布,便可以使用marginal histogram(边缘直方图?),它可以在散点图的边缘画出X和Y变量的分布直方图)

    this can be implemented using the ggMarginal() function from the 'ggExtra' package. Apart from a histogram, you could choose to draw a marginal boxplot or density plot by setting the repective type option.(marginal histogram可以通过ggExtra包的ggMarginal()函数实现,除了直方图,还可以选择画箱线图和密度图通过设置ggMarginal()函数各自的画图参数)。

    完整代码

    geom_count()函数 :overcome the problem of data points overlap. whereever there is more points overlap, the size of the circle gets bigger.

    PS:以前一直想通过library()函数加载包之后如果不在使用这个包有没有办法将其关闭加载,今天查到了一篇文章R语言-查看加载包、卸除加载包及安装包与卸载包 - CSDN博客,可以通过detach()函数实现,比如我想关闭ggplot2,就可以使用detach("package:ggplot2")命令;如果我想查看当前环境一共加载了哪些包,可以用(.packages())命令实现(括号和点号都有哈)。

    相关文章

      网友评论

        本文标题:每日一图Marginal Histogram/Boxplot

        本文链接:https://www.haomeiwen.com/subject/wjgsfftx.html