plot - Stata 重叠直方图重叠处颜色不同

标签 plot histogram transparency stata transparent

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

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

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

最佳答案

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

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))

关于plot - Stata 重叠直方图重叠处颜色不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39109806/

相关文章:

java - 无法创建半透明窗口

python - 根据函数绘制 PatchCollection

python - 如何获取两个列表中对应的值

python - matplotlib 的 histogramdd 是如何工作的?

java - Android 直方图均衡

c# - 紧凑型框架上的 GDI RoundRect : make rounded rectangle's outside transparent

css - 十六进制颜色 : Numeric representation for "transparent"?

java - 使用 JFreechart 绘制多重图(条形图,XY)

r - 在不影响情节的情况下控制ggplot2图异常(exception)观

r - 在 R 中使用 for 循环绘制许多直方图