Came here nine years later looking for a way to overlay two legend symbols for plotting confidence intervals as well, namely twoway line
and twoway rarea
. This will not work for twoway rcap
, but it does what I needed it to do:
sysuse auto.dta, clear
gen id = _n
gen price_h = price + 2000
gen price_l = price - 2000
twoway (scatter price id if id == 0, connect(line) lcolor(edkblue%30) lwidth(vvvthick) msymbol(|) msangle(90) msize(13)) (line price id, color(edkblue)) (rarea price_h price_l id, color(edkblue%30) lwidth(0)), legend(on order(1 "Mean with confidence interval"))