Hi!
I want to plot a series (cycger) against time while at the same time include recession shading into the graph. The source of the shading is a series (rec) which is defined as 1=recession, 0=no no recession for each quarter. I came up with the code below, however I encounter 2 problems:
- the shaded recession bars seems to become thinner from bottom to top (or I might just be too tired to recognise straight lines)
- the shaded recession bars are on top of the zero line
Could someone edit this little piece of code, so that the shaded area stays in the background and not on top of the horizontal line at zero?
Any help is appreciated.
#delimit ;
twoway (scatter rec time,
recast(area)
bcolor(gs13)
cmissing(n)
ylabel(0 1)
yaxis(1)
yscale(off))
(tsline cycger,
yaxis(2)
yscale(alt axis(2))
ytitle("Output Gap", axis(2))),
yline(0, axis(2))
;
#delimit cr
I want to plot a series (cycger) against time while at the same time include recession shading into the graph. The source of the shading is a series (rec) which is defined as 1=recession, 0=no no recession for each quarter. I came up with the code below, however I encounter 2 problems:
- the shaded recession bars seems to become thinner from bottom to top (or I might just be too tired to recognise straight lines)
- the shaded recession bars are on top of the zero line
Could someone edit this little piece of code, so that the shaded area stays in the background and not on top of the horizontal line at zero?
Any help is appreciated.
#delimit ;
twoway (scatter rec time,
recast(area)
bcolor(gs13)
cmissing(n)
ylabel(0 1)
yaxis(1)
yscale(off))
(tsline cycger,
yaxis(2)
yscale(alt axis(2))
ytitle("Output Gap", axis(2))),
yline(0, axis(2))
;
#delimit cr
Comment