【问题标题】:Stata Overlapping Histograms Different Color Where OverlapStata重叠直方图不同颜色重叠
【发布时间】:2016-08-23 20:05:00
【问题描述】:

当我们在同一个图上有两个直方图时,重叠部分是否可以有不同的颜色?我想到了一些可以在 SAS 中完成的事情:

http://blogs.sas.com/iml/uploads/dualhist.png

换句话说,其中一个直方图是半透明的。

【问题讨论】:

    标签: plot histogram transparency stata transparent


    【解决方案1】:

    虽然可以说有很多更好的方法来比较分布,但这显示了一些小技巧:

    sysuse auto, clear
    
    twoway histogram mpg if foreign, width(2) start(12) blcolor(red) bfcolor(none) fraction || histogram mpg if !foreign, width(2) start(10) barw(1.8) bfcolor(none) blcolor(blue) fraction ytitle(Proportions) legend(order(1 "Foreign" 2 "Domestic") col(1) pos(1) ring(0))
    

    【讨论】:

    • 您对比较分布的其他更好的方法有什么想法?我全神贯注。
    • 分位数图、平行点图等
    • stata.com/meeting/chicago16/slides/chicago16_cox.pptx 是一个概述。 (在幻灯片 20 上,“反转符号”是“反转顺序”的愚蠢错误;当您阅读此文件时可能会更正该文件。)
    • 也感谢您提供该参考资料。
    猜你喜欢
    • 2016-12-19
    • 1970-01-01
    • 2013-10-07
    • 2018-03-26
    • 1970-01-01
    • 2014-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多