Hi, all. I am not sure why I get this horizontal line in the graph. It seems that when the graph is generated, it does not show up but only shows up in the graph when saved. I also had the same issue on Stata18. Thanks!
Code:
* Graph
graph twoway (rcap cal_ul_var cal_ll_var quarter_jitter2, msize(*.5) color(blue) yline(12321, lstyle(foreground)) yaxis(1)) ///
(scatter cal_mean_value_var quarter_jitter2, msize(*.5) color(blue) yaxis(1) ytitle("Food Expenditure, deflated", size(3) axis(1)) xtitle("Reference Quarter", size(3) axis(1))), ///
ylabel(70(5)100, angle(0)) ///
xscale(range(0.5 4.5)) ///
xtick(0.5 1.5 2.5 3.5 4.5) ///
xlabel(1 "Q1 (Jan-Mar)" 2 "Q2 (Apr-Jun)" 3 "Q3 (Jul-Sep)" 4 "Q4 (Oct-Dec)", labsize(2.5) nogrid noticks) ///
title("Survey: MWI_IHS_2019", size(3)) ///
note("NOTE: Lean season: Jan, Feb, Nov, & Dec. Computed using recall method. Using derived prices (i) and median for each district and each quarter when (1) not available.", size(1.5)) ///
legend(off) //
graph export "${outputloc}meals_stats/graphs/MWI/IHS_2019/_fexp_median_plus_cpi/Food_Exp.png", as(png) replace
graph export "${outputloc}meals_stats/graphs/MWI/IHS_2019/_fexp_median_plus_cpi/Food_Exp.pdf", as(pdf) replace
Code:
* Graph
graph twoway (rcap cal_ul_var cal_ll_var quarter_jitter2, msize(*.5) color(blue) yline(12321, lstyle(foreground)) yaxis(1)) ///
(scatter cal_mean_value_var quarter_jitter2, msize(*.5) color(blue) yaxis(1) ytitle("Food Expenditure, deflated", size(3) axis(1)) xtitle("Reference Quarter", size(3) axis(1))), ///
ylabel(70(5)100, angle(0)) ///
xscale(range(0.5 4.5)) ///
xtick(0.5 1.5 2.5 3.5 4.5) ///
xlabel(1 "Q1 (Jan-Mar)" 2 "Q2 (Apr-Jun)" 3 "Q3 (Jul-Sep)" 4 "Q4 (Oct-Dec)", labsize(2.5) nogrid noticks) ///
title("Survey: MWI_IHS_2019", size(3)) ///
note("NOTE: Lean season: Jan, Feb, Nov, & Dec. Computed using recall method. Using derived prices (i) and median for each district and each quarter when (1) not available.", size(1.5)) ///
legend(off) //
graph export "${outputloc}meals_stats/graphs/MWI/IHS_2019/_fexp_median_plus_cpi/Food_Exp.png", as(png) replace
graph export "${outputloc}meals_stats/graphs/MWI/IHS_2019/_fexp_median_plus_cpi/Food_Exp.pdf", as(pdf) replace
Comment