Dear Stata users,
A simple question here: Is there any connection between Nick Cox's -zmap- and Ben Jann's -heatplot- (all from SSC). The two commands can generate plots that are very much alike (see plots that I attached below). And heatplot is clearly designed to create heat plots (maps). However, it seems to me that Nick's initial purpose of writing zmap was not to produce any kind of heat maps.


A simple question here: Is there any connection between Nick Cox's -zmap- and Ben Jann's -heatplot- (all from SSC). The two commands can generate plots that are very much alike (see plots that I attached below). And heatplot is clearly designed to create heat plots (maps). However, it seems to me that Nick's initial purpose of writing zmap was not to produce any kind of heat maps.
Code:
webuse nlswork egen mean = mean(ln_wage), by(age grade) egen tag = tag(age grade) label var mean "mean ln wage" su ln_wage if !missing(age, grade), detail zmap mean grade age if tag, breaks(.993 1.166 1.361 1.641 1.964 2.275 2.456) ms(S ..) ysc(on) xsc(on) legend(on pos(3) col(1)) yla(0/18, ang(h)) ytitle(`: var label grade') title("") xla(15(5)45) note("") mcolor(stc1) name(zmap, replace) heatplot mean grade age, discrete levels(8) color(st) ylabel(0/18, ang(h)) xlabel(15(5)45) name(heatplot, replace) heatplot mean grade age, discrete levels(8) color(st) ylabel(0/18, ang(h)) xlabel(15(5)45) scatter(S) name(heatplot2, replace) graph combine zmap heatplot, name(g1) graph combine zmap heatplot2, name(g2)
Comment