Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 3 Way Area Histograms

    Hi,
    I'm fairly new to stata and am using stata 17. I am trying to make a histogram with a log scale to show the size distribution of forest area for 3 different years. I can currently make it with two of them but cannot add a third and am looking for a way to do it. This is the code I am currently using:

    histogram log10con2000, start(-1) width(0.125) xla(0 "0" 1 "10" 2 "100" 3 "1000"4 "10000" 5 "100000") xtitle(Area (m2)) frequency bfc(red*0.2%1) blc(red*0.4) addplot(histogram log10con2019, start(-1) width(0.125) xla(0 "0" 1 "10" 2"100" 3 "1000" 4 "10000" 5 "100000") xtitle(Area (m2)) frequency bfc(blue*0.2%1) blc(blue*0.5)) legend(order(1 "2000" 2 "2019") col(1) ring(0) pos(11))

    Any help would be greatly appreciated,
    Thanks!


  • #2
    Code:
    set scheme s1mono
    sysuse nlsw88, clear
    gen lnwage = ln(wage)
    
    twoway hist lnwage , by(race, cols(1) compact note("")) ///
        subtitle(, pos(9) ring(1) nobexpand bcolor(none) placement(e)) ///
        ylab(,angle(0)) ///
        xlab(`=ln(1)' "1" `=ln(2)' "2" `=ln(5)' "5" `=ln(10)' "10" `=ln(20)' "20"  `=ln(50)' "50") ///
        xtitle("hourly wage (log scale)")
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X