plot - Stata Overlapping Histograms Different Color Where Overlap -


is possible have different color in portions of overlap when have 2 histograms on same plot? have in mind can done in sas:

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

in other words, 1 of histograms semi-transparent.

although there arguably many better ways compare distributions, shows small tricks:

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

.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -