79513345

Date: 2025-03-16 22:56:30
Score: 1
Natty:
Report link

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:

Line graph with `rarea` type confidence intervals

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"))
Reasons:
  • Blacklisted phrase (0.5): I need
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Moritz Poll